From: Angelo Mirabella Date: Tue, 16 Jun 2020 09:04:06 +0000 (+0100) Subject: detect/http_raw_header: Correct type mismatch X-Git-Tag: suricata-5.0.4~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=137cca09b1b11313c031be8c9e33461336e720d3;p=thirdparty%2Fsuricata.git detect/http_raw_header: Correct type mismatch This changeset fixes a bug on the computation of the buffer lenght for raw http headers. The bug is due to a mismatch on the data type of the length (uint8_t vs uint32_t) and it was causing signature misses. (cherry picked from commit 0cdc009da1c97784b3c1742b33fa817e9597ea68) --- diff --git a/src/detect-http-raw-header.c b/src/detect-http-raw-header.c index f4e96a6988..718fcd8356 100644 --- a/src/detect-http-raw-header.c +++ b/src/detect-http-raw-header.c @@ -186,7 +186,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx, tx_ud->request_headers_raw : tx_ud->response_headers_raw; if (data == NULL) return NULL; - const uint8_t data_len = ts ? + const uint32_t data_len = ts ? tx_ud->request_headers_raw_len : tx_ud->response_headers_raw_len; InspectionBufferSetup(buffer, data, data_len);