From: Victor Julien Date: Mon, 18 Dec 2023 07:04:52 +0000 (+0100) Subject: detect/bytemath: fix u32 buffer size logic X-Git-Tag: suricata-8.0.0-beta1~1879 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e8db9768753dc8a4c0c3c4b6f1839bdedf54a41;p=thirdparty%2Fsuricata.git detect/bytemath: fix u32 buffer size logic Remove u16 cast. Remove debug assert for u16 size. In 83ed2c3b97925d390c2a57fdc8eea52f7d3d2e4c the input was changed to u32 --- diff --git a/src/detect-engine-content-inspection.c b/src/detect-engine-content-inspection.c index b204d1edaa..a4fa5c72b7 100644 --- a/src/detect-engine-content-inspection.c +++ b/src/detect-engine-content-inspection.c @@ -594,8 +594,7 @@ static int DetectEngineContentInspectionInternal(DetectEngineThreadCtx *det_ctx, nbytes = bmd->nbytes; } - DEBUG_VALIDATE_BUG_ON(buffer_len > UINT16_MAX); - if (DetectByteMathDoMatch(det_ctx, bmd, s, buffer, (uint16_t)buffer_len, nbytes, rvalue, + if (DetectByteMathDoMatch(det_ctx, bmd, s, buffer, buffer_len, nbytes, rvalue, &det_ctx->byte_values[bmd->local_id], endian) != 1) { goto no_match; }