]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/http_start: check if 'line' is valid 3038/head
authorVictor Julien <victor@inliniac.net>
Fri, 1 Dec 2017 08:23:29 +0000 (09:23 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 1 Dec 2017 13:25:09 +0000 (14:25 +0100)
In certain conditions like low memory the line can be NULL.

Bug #2307.

src/detect-http-start.c

index 2d587dc228bf49918aa36b55f4964ed7316431db..914ecca4cd9857b26f28edadfc36e4d191f15230 100644 (file)
@@ -109,7 +109,7 @@ static uint8_t *GetBufferForTX(htp_tx_t *tx, uint64_t tx_id,
         headers = tx->response_headers;
         line = tx->response_line;
     }
-    if (headers == NULL)
+    if (line == NULL || headers == NULL)
         return NULL;
 
     size_t line_size = bstr_len(line) + 2;