]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/requires: reset sigerror flags for each rule
authorJason Ish <jason.ish@oisf.net>
Wed, 24 Jan 2024 15:02:19 +0000 (09:02 -0600)
committerJason Ish <jason.ish@oisf.net>
Wed, 24 Jan 2024 15:51:36 +0000 (09:51 -0600)
"sigerror_ok" and "sigerror_requires" were not being reset after each
rule which could lead to a rule load error being incorrectly tracked
as skipped rather than failed.

Also initialize "skippedsigs" to 0 along with "goodsigs" and
"badsigs", while not directly related to this issue, could also throw
off some stats.

Ticket: #6710

src/detect-engine-loader.c
src/detect-parse.c

index 9c3e3e8b533cd1c04a10636f098d5d445806b465..1f5363c6f80c02dde46aa3f39535eef1aaadbccb 100644 (file)
@@ -122,6 +122,7 @@ static int DetectLoadSigFile(
 
     (*goodsigs) = 0;
     (*badsigs) = 0;
+    (*skippedsigs) = 0;
 
     FILE *fp = fopen(sig_file, "r");
     if (fp == NULL) {
index 31df3d0aaed317f492558aad7132231dc4117b29..e1c073efd6a3a228f76207a9f5b475d440f63d54 100644 (file)
@@ -2315,7 +2315,9 @@ Signature *SigInit(DetectEngineCtx *de_ctx, const char *sigstr)
     SCEnter();
 
     uint32_t oldsignum = de_ctx->signum;
+    de_ctx->sigerror_ok = false;
     de_ctx->sigerror_silent = false;
+    de_ctx->sigerror_requires = false;
 
     Signature *sig;