From 584248dfbf6eb7ff0f8e4f0a8c2007ba4df0636d Mon Sep 17 00:00:00 2001 From: Mark Trostler Date: Mon, 23 Jul 2018 10:18:49 -0700 Subject: [PATCH] Ensure host offset & length are initialized - fuzzer found possible leaks --- http_parser.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/http_parser.c b/http_parser.c index 9941b7ea..876d1e52 100644 --- a/http_parser.c +++ b/http_parser.c @@ -2323,6 +2323,10 @@ http_parser_parse_url(const char *buf, size_t buflen, int is_connect, if (buflen == 0) { return 1; } + + /* Ensure these are initialized to sane values */ + u->field_data[UF_HOST].off = 0; + u->field_data[UF_HOST].len = 0; u->port = u->field_set = 0; s = is_connect ? s_req_server_start : s_req_spaces_before_url;