]> granicus.if.org Git - libevent/commitdiff
http: do not try to parse request-line if we do not have enough bytes
authorAzat Khuzhin <a3at.mail@gmail.com>
Mon, 22 Oct 2018 20:56:50 +0000 (23:56 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Mon, 22 Oct 2018 20:56:50 +0000 (23:56 +0300)
http.c

diff --git a/http.c b/http.c
index 9a641da832b93da9f0114d50971b62c65061154a..636ac5a31456de571327141492eac98f80322cf0 100644 (file)
--- a/http.c
+++ b/http.c
@@ -1702,6 +1702,8 @@ evhttp_parse_request_line(struct evhttp_request *req, char *line, size_t len)
                --eos;
                --len;
        }
+       if (len < strlen("GET / HTTP/1.0"))
+               return -1;
 
        /* Parse the request line */
        method = strsep(&line, " ");