summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorAzat Khuzhin <a3at.mail@gmail.com>2018-10-22 23:56:50 +0300
committerAzat Khuzhin <a3at.mail@gmail.com>2018-10-22 23:56:50 +0300
commit64ead341a021a42084bb224100dda19311f2ac3e (patch)
tree238e1e291dfd1d37921fe90095d181714bf5fe7f /http.c
parent254fbc81b43eb8de42c7723a3f129ac529ebc9f4 (diff)
downloadlibevent-64ead341a021a42084bb224100dda19311f2ac3e.tar.gz
http: do not try to parse request-line if we do not have enough bytes
Diffstat (limited to 'http.c')
-rw-r--r--http.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/http.c b/http.c
index 9a641da8..636ac5a3 100644
--- 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, " ");