]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/http_raw_header: Correct type mismatch
authorAngelo Mirabella <amirabella@lastline.com>
Tue, 16 Jun 2020 09:04:06 +0000 (10:04 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 29 Jun 2020 10:19:14 +0000 (12:19 +0200)
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)

src/detect-http-raw-header.c

index f4e96a698881b9197fccf6ee86c805e8510ad8b3..718fcd8356f162545aceae1032366d971ec37e45 100644 (file)
@@ -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);