mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
http: allow non RFC3986 conformant during parsing request-line (http server)
Reported-by: lsdyst@163.com
This commit is contained in:
parent
64ead341a0
commit
b94d913d90
16
http.c
16
http.c
@ -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_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user