Add a forgotten NULL check to evhttp_parse_headers

Issue detected by the clang static analyzer
This commit is contained in:
Sebastian Hahn 2011-03-14 04:13:55 +01:00
parent ad9ff5834a
commit 12311ff46e

3
http.c
View File

@ -1777,7 +1777,8 @@ evhttp_parse_headers(struct evhttp_request *req, struct evbuffer* buffer)
}
if (status == MORE_DATA_EXPECTED) {
if (req->headers_size + evbuffer_get_length(buffer) > req->evcon->max_headers_size)
if (req->evcon != NULL &&
req->headers_size + evbuffer_get_length(buffer) > req->evcon->max_headers_size)
return (DATA_TOO_LONG);
}