mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-25 14:12:13 +00:00
BUG/MEDIUM: don't trim last spaces from headers consisting only of spaces
Commit 588bd4 fixed header parsing so that trailing spaces were not part of the returned string. Unfortunately, if a header only had spaces, the last spaces were trimmed past the beginning of the value, causing a negative length to be returned. A quick code review shows that there should be no impact since the only places where the vlen is used are either compared to a specific value or with explicit contents (eg: digits). This must be backported to 1.4.
This commit is contained in:
parent
85c27da67e
commit
275600b6c7
@ -552,7 +552,7 @@ int http_find_header2(const char *name, int len,
|
||||
|
||||
eol = find_hdr_value_end(sov, eol);
|
||||
ctx->tws = 0;
|
||||
while (http_is_lws[(unsigned char)*(eol - 1)]) {
|
||||
while (eol > sov && http_is_lws[(unsigned char)*(eol - 1)]) {
|
||||
eol--;
|
||||
ctx->tws++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user