Project

General

Profile

Actions

Bug #6839

closed
VJ SB

coverity: warning in port grouping code

Bug #6839: coverity: warning in port grouping code

Added by Victor Julien about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description


** CID 1592992:  Incorrect expression  (COPY_PASTE_ERROR)
/src/util-port-interval-tree.c: 255 in SCPortIntervalFindOverlaps()

________________________________________________________________________________________________________
*** CID 1592992:  Incorrect expression  (COPY_PASTE_ERROR)
/src/util-port-interval-tree.c: 255 in SCPortIntervalFindOverlaps()
249                      * will be sorted, insert any new ports to the end of the list
250                      * and avoid walking the entire list */
251                     if (*list == NULL) {
252                         *list = new_port;
253                         (*list)->last = new_port;
254                     } else if (((*list)->last->port != new_port->port) &&
>>>     CID 1592992:  Incorrect expression  (COPY_PASTE_ERROR)
>>>     "port" in "(*list)->last->port2 != new_port->port" looks like a copy-paste error.
255                                ((*list)->last->port2 != new_port->port)) {
256                         DEBUG_VALIDATE_BUG_ON(new_port->port < (*list)->last->port);
257                         (*list)->last->next = new_port;
258                         new_port->prev = (*list)->last;
259                         (*list)->last = new_port;
260                     } else {

Subtasks 1 (0 open1 closed)

Bug #6845: coverity: warning in port grouping code (7.0.x backport)ClosedShivani BhardwajActions

VJ Updated by Victor Julien about 2 years ago Actions #1

Please review if the code is correct. If it is, we can add a suppression.

SB Updated by Shivani Bhardwaj about 2 years ago Actions #2

Victor Julien wrote in #note-1:

Please review if the code is correct. If it is, we can add a suppression.

I think it is but we can safely fix the warning as the case when this can happen port == port2 anyway

SB Updated by Shivani Bhardwaj about 2 years ago Actions #3

  • Status changed from Assigned to In Review

SB Updated by Shivani Bhardwaj about 2 years ago Actions #4

  • Status changed from In Review to Resolved
  • Label Needs backport to 7.0 added

OT Updated by OISF Ticketbot about 2 years ago Actions #5

  • Subtask #6845 added

OT Updated by OISF Ticketbot about 2 years ago Actions #6

  • Label deleted (Needs backport to 7.0)

SB Updated by Shivani Bhardwaj almost 2 years ago Actions #7

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom