From d31beba8d4e75218994a6654af41c947cf24ae51 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 26 Aug 2022 20:45:33 +0200 Subject: [PATCH] detect/frames: fix too strict debug check Frame::len is -1 if it is still unknown. Handle that in the debug check. --- src/detect-engine-frame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detect-engine-frame.c b/src/detect-engine-frame.c index 647456e270..7b81108f80 100644 --- a/src/detect-engine-frame.c +++ b/src/detect-engine-frame.c @@ -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;