http: allow non RFC3986 conformant during parsing request-line (http server)

Reported-by: lsdyst@163.com
This commit is contained in:
Azat Khuzhin 2018-10-22 23:52:46 +03:00
parent 64ead341a0
commit b94d913d90
No known key found for this signature in database
GPG Key ID: B86086848EF8686D

16
http.c
View File

@ -1707,14 +1707,14 @@ evhttp_parse_request_line(struct evhttp_request *req, char *line, size_t len)
/* Parse the request line */
method = strsep(&line, " ");
if (line == NULL)
return (-1);
uri = strsep(&line, " ");
if (line == NULL)
return (-1);
version = strsep(&line, " ");
if (line != NULL)
return (-1);
if (!line)
return -1;
uri = line;
version = strrchr(uri, ' ');
if (!version || uri == version)
return -1;
*version = '\0';
version++;
method_len = (uri - method) - 1;
type = EVHTTP_REQ_UNKNOWN_;