From: Willy Tarreau Date: Thu, 25 Jan 2007 11:03:42 +0000 (+0100) Subject: [BUG] hdr_idx might be left uninitialized in some cases X-Git-Tag: v1.3.7~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0d058e8aba2db2034754f02ec70050d69354279;p=thirdparty%2Fhaproxy.git [BUG] hdr_idx might be left uninitialized in some cases When a request is invalid during RQ_BEFORE AND the debug mode is active, the hdr_idx might be used uninitialized. Let's initialize it right after the accept() for now. --- diff --git a/src/client.c b/src/client.c index c72f7e4e53..e4babba081 100644 --- a/src/client.c +++ b/src/client.c @@ -252,6 +252,7 @@ int event_accept(int fd) { pool_free(session, s); return 0; } + hdr_idx_init(&hreq->hdr_idx); } if ((p->mode == PR_MODE_TCP || p->mode == PR_MODE_HTTP) diff --git a/src/proto_http.c b/src/proto_http.c index 94d354cbae..5aad97d044 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -906,7 +906,9 @@ void http_msg_analyzer(struct buffer *buf, struct http_msg *msg, struct hdr_idx end = buf->r; #endif } - hdr_idx_init(idx); + /* we will need this when keep-alive will be supported + hdr_idx_init(idx); + */ state = HTTP_MSG_RQMETH; goto http_msg_rqmeth; }