mirror of
https://github.com/nmap/nmap.git
synced 2026-09-12 06:31:44 +00:00
Fix 2 issues found by fuzz_http
This commit is contained in:
parent
5a9db5582e
commit
d8d0af7f0f
1 changed files with 2 additions and 1 deletions
|
|
@ -809,7 +809,7 @@ char *http_request_to_string(const struct http_request *request, size_t *n)
|
|||
present in the original URI, it MUST be given as "/" (the server
|
||||
root)." */
|
||||
path = request->uri.path;
|
||||
if (path[0] == '\0')
|
||||
if (path == NULL || path[0] == '\0')
|
||||
path = "/";
|
||||
|
||||
if (request->version == HTTP_09) {
|
||||
|
|
@ -982,6 +982,7 @@ int http_parse_header(struct http_header **result, const char *header)
|
|||
q = p;
|
||||
while (*q != '\0' && !is_space_char(*q) && !is_crlf(q)) {
|
||||
if (is_ctl_char(*q)) {
|
||||
FREE_AND_NULL(http_header_node_free, node);
|
||||
FREE_AND_NULL(http_header_free, *result);
|
||||
return 400;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue