From: Shivani Bhardwaj Date: Mon, 20 Nov 2023 12:30:37 +0000 (+0530) Subject: detect/engine: defensive check and comment update X-Git-Tag: suricata-8.0.0-beta1~1983 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8a887e518bde0a146bad4062f668bd30e4839c8;p=thirdparty%2Fsuricata.git detect/engine: defensive check and comment update --- diff --git a/src/detect-engine-build.c b/src/detect-engine-build.c index e6804b57b3..42b439945b 100644 --- a/src/detect-engine-build.c +++ b/src/detect-engine-build.c @@ -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. */