From: Sebastian Hahn Date: Mon, 14 Mar 2011 03:13:55 +0000 (+0100) Subject: Add a forgotten NULL check to evhttp_parse_headers X-Git-Tag: release-2.0.11-stable~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12311ff46e72d3a3ffe9625ccba42a2f15ff0827;p=libevent Add a forgotten NULL check to evhttp_parse_headers Issue detected by the clang static analyzer --- diff --git a/http.c b/http.c index 0bdf2fa8..df54be7e 100644 --- a/http.c +++ b/http.c @@ -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); }