BUG/MEDIUM: http: Use pointer to the begining of input to parse message headers

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.
This commit is contained in:
Christopher Faulet 2019-05-10 11:36:51 +02:00
parent 7a3367cca0
commit 132f7b496c

View 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;