]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/engine: defensive check and comment update
authorShivani Bhardwaj <shivani@oisf.net>
Mon, 20 Nov 2023 12:30:37 +0000 (18:00 +0530)
committerVictor Julien <victor@inliniac.net>
Tue, 5 Dec 2023 10:33:09 +0000 (11:33 +0100)
src/detect-engine-build.c

index e6804b57b37dce53b9ef3d27ba08ca753a80a230..42b439945b80036eb8ec4c8764ada08bc076a414 100644 (file)
@@ -1264,6 +1264,7 @@ static DetectPort *RulesGroupByPorts(DetectEngineCtx *de_ctx, uint8_t ipproto, u
     DetectPort *iter;
     for (iter = list ; iter != NULL; iter = iter->next) {
         BUG_ON (iter->sh == NULL);
+        DEBUG_VALIDATE_BUG_ON(own + ref != cnt);
         cnt++;
 
         SigGroupHead *lookup_sgh = SigGroupHeadHashLookup(de_ctx, iter->sh);
@@ -1579,7 +1580,7 @@ int CreateGroupedPortList(DetectEngineCtx *de_ctx, DetectPort *port_list, Detect
     uint32_t groups = 0;
     DetectPort *list;
 
-    /* insert the addresses into the tmplist, where it will
+    /* insert the ports into the tmplist, where it will
      * be sorted descending on 'cnt' and on whether a group
      * is whitelisted. */