mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-25 07:41:36 +02:00
BUG/MEDIUM: http: functions set-{path,query,method,uri} breaks the HTTP parser
When one of these functions replaces a part of the query string by a shorter or longer new one, the header parsing is broken. This is because the start of the first header is not updated. In the same way, the total length of the request line is not updated. I dont see any bug caused by this miss, but I guess than it is better to store the good length. This bug is only in the development version.
This commit is contained in:
parent
e91ffd093e
commit
7f6192c0d3
@ -11825,6 +11825,8 @@ int http_replace_req_line(int action, const char *replace, int len,
|
|||||||
|
|
||||||
/* commit changes and adjust end of message */
|
/* commit changes and adjust end of message */
|
||||||
delta = buffer_replace2(s->req.buf, cur_ptr, cur_end, replace + offset, len - offset);
|
delta = buffer_replace2(s->req.buf, cur_ptr, cur_end, replace + offset, len - offset);
|
||||||
|
txn->req.sl.rq.l += delta;
|
||||||
|
txn->hdr_idx.v[0].len += delta;
|
||||||
http_msg_move_end(&txn->req, delta);
|
http_msg_move_end(&txn->req, delta);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user