]> 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)
committerVictor Julien <victor@inliniac.net>
Thu, 25 Jan 2024 12:18:07 +0000 (13:18 +0100)
"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
(cherry picked from commit de3cbe4c90fb7fb6d54b6876ab515f791145271a)

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

index f3dae1b223e511c2517a8c91a5aef196f37f651a..e41f27779f5dce5b5bf1bea00959923735289766 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 78fecb4fdc863c492349ecf307676d0f6edce163..b5e214df24458c4d0ef85732563d076c4d2a1769 100644 (file)
@@ -2338,7 +2338,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;