]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/frames: fix too strict debug check
authorVictor Julien <vjulien@oisf.net>
Fri, 26 Aug 2022 18:45:33 +0000 (20:45 +0200)
committerShivani Bhardwaj <shivani@oisf.net>
Mon, 29 Aug 2022 04:25:59 +0000 (09:55 +0530)
Frame::len is -1 if it is still unknown. Handle that in the debug
check.

src/detect-engine-frame.c

index 647456e2709ec3fcb697435ca00af3ae591f8295..7b81108f806b4bc41c32ff7e094c19f11a38b011 100644 (file)
@@ -89,7 +89,7 @@ static void PrefilterMpmFrame(DetectEngineThreadCtx *det_ctx, const void *pectx,
             det_ctx, ctx->transforms, p, frames, frame, ctx->list_id, idx, true);
     if (buffer == NULL)
         return;
-    DEBUG_VALIDATE_BUG_ON(buffer->orig_len > frame->len);
+    DEBUG_VALIDATE_BUG_ON(frame->len >= 0 && buffer->orig_len > frame->len);
 
     const uint32_t data_len = buffer->inspect_len;
     const uint8_t *data = buffer->inspect;