]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] hdr_idx might be left uninitialized in some cases
authorWilly Tarreau <w@1wt.eu>
Thu, 25 Jan 2007 11:03:42 +0000 (12:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 25 Jan 2007 11:03:42 +0000 (12:03 +0100)
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.

src/client.c
src/proto_http.c

index c72f7e4e5367c7b953958735e402ce6588a6605f..e4babba0813450174e189f46e49910b0da16c884 100644 (file)
@@ -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)
index 94d354cbaed35f5a4f1742d358504a4316ad2172..5aad97d044e2a81b012abe0b2cd9e06f422c81de 100644 (file)
@@ -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;
                }