BUG/MINOR: h1-htx: Fix a signess bug with char data type when parsing chunk size
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 11 Jun 2021 11:39:06 +0000 (13:39 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 11 Jun 2021 12:15:48 +0000 (14:15 +0200)
commitbf76df12a6eb8a69939da026815b6daa9dfd7147
treee15c100d7902c2b3a8701c511f43ca106337e534
parent5cd0e528cf2bed6eb1f79582ef89cf1667337e46
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.
src/h1_htx.c