From 12311ff46e72d3a3ffe9625ccba42a2f15ff0827 Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Mon, 14 Mar 2011 04:13:55 +0100 Subject: [PATCH] Add a forgotten NULL check to evhttp_parse_headers Issue detected by the clang static analyzer --- http.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 2.40.0