]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: http: Use pointer to the begining of input to parse message headers
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 10 May 2019 09:36:51 +0000 (11:36 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 10 May 2019 09:47:00 +0000 (11:47 +0200)
In the legacy HTTP, when the message headers are parsed, in http_msg_analyzer(),
we must use the begining of input and not the head of the buffer. Most of time,
it will be the same pointers because there is no outgoing data when a new
message is received. But when a 1xx informational response is parsed, it is
forwarded and the parsing restarts immediatly. In this case, we have outgoing
data when the next response is parsed.

This patch must be backported to 1.9.

src/http_msg.c

index d422f59a316d0819c413c2c61f464ce62a992ef4..067a7f863db627cdb304e03b8bf287c335e7d79a 100644 (file)
@@ -832,7 +832,7 @@ void http_msg_analyzer(struct http_msg *msg, struct hdr_idx *idx)
        enum h1_state state;       /* updated only when leaving the FSM */
        register const char *ptr, *end; /* request pointers, to avoid dereferences */
        struct buffer *buf = &msg->chn->buf;
-       char *input = b_head(buf);
+       char *input = ci_head(msg->chn);
 
        state = msg->msg_state;
        ptr = input + msg->next;