From b94d913d90a7390ace32dbe025d69b41eb98f755 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 22 Oct 2018 23:52:46 +0300 Subject: [PATCH] http: allow non RFC3986 conformant during parsing request-line (http server) Reported-by: lsdyst@163.com --- http.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/http.c b/http.c index 636ac5a3..181352b6 100644 --- a/http.c +++ b/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_; -- 2.50.1