Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Ensure host offset & length are initialized - fuzzer found possible leaks #440

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions http_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down