mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-21 21:26:58 +00:00
BUG/MINOR: h1-htx: Fix a signess bug with char data type when parsing chunk size
On some platform, a char may be unsigned. Of course, we should not rely on the signess of a char to be portable. Unfortunatly, since the commit a835f3cb ("MINOR: h1-htx: Use a correlation table to speed-up small chunks parsing") we rely on it to test the value retrieved from the hexadecimal correlation table when the size of a chunk is parsed. To fix the bug, we now test the result is in the range [0,15] with a bitwise AND. This patch should fix the issue #1272. It is 2.5-specific, no backport is needed except if the commit above is backported.
This commit is contained in:
parent
5cd0e528cf
commit
bf76df12a6
@ -612,7 +612,7 @@ static size_t h1_parse_full_contig_chunks(struct h1m *h1m, struct htx **dsthtx,
|
||||
c = hextable[(unsigned char)end[ridx]];
|
||||
|
||||
/* not a hex digit anymore */
|
||||
if (c < 0)
|
||||
if (c & 0xF0)
|
||||
break;
|
||||
|
||||
/* Update current chunk size */
|
||||
|
Loading…
Reference in New Issue
Block a user