mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-18 19:56:59 +00:00
[MINOR] frontend: improve accept-proxy header parsing
The accept-proxy now automatically fails as soon as a character does not match the expected syntax.
This commit is contained in:
parent
3041b9fcc3
commit
f4711a3221
@ -287,13 +287,17 @@ int frontend_decode_proxy_request(struct session *s, struct buffer *req, int an_
|
||||
if (req->flags & (BF_READ_ERROR|BF_READ_TIMEOUT))
|
||||
goto fail;
|
||||
|
||||
if (req->l < 18) /* shortest possible line */
|
||||
len = MIN(req->l, 6);
|
||||
if (!len)
|
||||
goto missing;
|
||||
|
||||
/* Decode a possible proxy request */
|
||||
if (memcmp(line, "PROXY ", 6) != 0)
|
||||
/* Decode a possible proxy request, fail early if it does not match */
|
||||
if (strncmp(line, "PROXY ", len) != 0)
|
||||
goto fail;
|
||||
|
||||
line += 6;
|
||||
if (req->l < 18) /* shortest possible line */
|
||||
goto missing;
|
||||
|
||||
if (memcmp(line, "TCP4 ", 5) != 0)
|
||||
goto fail;
|
||||
|
Loading…
Reference in New Issue
Block a user