]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: use do { } while loop for app engine loop
authorVictor Julien <vjulien@oisf.net>
Thu, 21 Dec 2023 10:35:22 +0000 (11:35 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 8 Jan 2024 19:23:28 +0000 (20:23 +0100)
src/detect.c

index d671a3866fa5a932787886ce7c633e5f2064dd8c..494886c22e41aec20ef3a0c0694c83817fad4ccd 100644 (file)
@@ -1097,7 +1097,7 @@ static bool DetectRunTxInspectRule(ThreadVars *tv,
     }
 
     const DetectEngineAppInspectionEngine *engine = s->app_inspect;
-    while (engine != NULL) { // TODO could be do {} while as s->app_inspect cannot be null
+    do {
         TRACE_SID_TXS(s->id, tx, "engine %p inspect_flags %x", engine, inspect_flags);
         if (!(inspect_flags & BIT_U32(engine->id)) &&
                 direction == engine->dir)
@@ -1178,7 +1178,7 @@ static bool DetectRunTxInspectRule(ThreadVars *tv,
             break;
         }
         engine = engine->next;
-    }
+    } while (engine != NULL);
     TRACE_SID_TXS(s->id, tx, "inspect_flags %x, total_matches %u, engine %p",
             inspect_flags, total_matches, engine);