-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util/interval-tree: fix coverity warning #10593
Conversation
Fix Coverity warning ** 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 { The code does not generate two port ranges that are same other than the cases where port == port2 which is why it worked so far. Fix it. Bug 6839
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #10593 +/- ##
===========================================
+ Coverage 64.07% 82.73% +18.65%
===========================================
Files 851 924 +73
Lines 135327 247447 +112120
===========================================
+ Hits 86716 204721 +118005
+ Misses 48611 42726 -5885
Flags with carried forward coverage won't be shown. Click here to find out more. |
Are the load times affected by this change? |
No. Following is the fresh result on my system.
vs
|
How does it compare to w/o the fix? |
Apologies. Please check the updated comment above with fresh results off my system. |
Information: QA ran without warnings. Pipeline 19084 |
Merged in #10600, thanks! |
Link to redmine ticket: https://redmine.openinfosecfoundation.org/issues/6839