From: Victor Julien Date: Thu, 21 Dec 2023 10:35:22 +0000 (+0100) Subject: detect: use do { } while loop for app engine loop X-Git-Tag: suricata-8.0.0-beta1~1868 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b3ec34de80816b06c26495d331a863ae3567b96;p=thirdparty%2Fsuricata.git detect: use do { } while loop for app engine loop --- diff --git a/src/detect.c b/src/detect.c index d671a3866f..494886c22e 100644 --- a/src/detect.c +++ b/src/detect.c @@ -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);