]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/dsize: define offset in edge case
authorPhilippe Antoine <pantoine@oisf.net>
Mon, 7 Jul 2025 19:25:16 +0000 (21:25 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 30 Aug 2025 07:51:05 +0000 (09:51 +0200)
Ticket: 7802

src/detect-content.c

index 652a10e533fe4dbee553ff8d2ac9236926903468..9e841af054e3ccbbeb1fb925a78cc1651224b39b 100644 (file)
@@ -412,6 +412,8 @@ void SigParseRequiredContentSize(
 {
     int max_offset = 0, total_len = 0;
     bool first = true;
+    // define it first, and override it unless in DETECT_CONTENT_NEGATED edge case
+    *offset = 0;
     for (; sm != NULL; sm = sm->next) {
         if (sm->type != DETECT_CONTENT || sm->ctx == NULL) {
             continue;