From: Victor Julien Date: Sun, 10 Apr 2022 13:45:36 +0000 (+0200) Subject: detect/frame: improve assert accuracy X-Git-Tag: suricata-7.0.0-beta1~762 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61df4120da9a1ce1696d8d5408101c05aa33e3e0;p=thirdparty%2Fsuricata.git detect/frame: improve assert accuracy Handle frames of unknown size correctly. Bug: #5226. --- diff --git a/src/detect-engine-frame.c b/src/detect-engine-frame.c index 330b084068..6aeda8048f 100644 --- a/src/detect-engine-frame.c +++ b/src/detect-engine-frame.c @@ -384,7 +384,7 @@ int DetectEngineInspectFrameBufferGeneric(DetectEngineThreadCtx *det_ctx, // PrintRawDataFp(stdout, data, data_len); // PrintRawDataFp(stdout, data, MIN(64, data_len)); #endif - BUG_ON((int64_t)data_len > frame->len); + BUG_ON(frame->len > 0 && (int64_t)data_len > frame->len); // TODO don't call if matching needs frame end and DETECT_CI_FLAGS_END not set // TODO same for start