BUG/MINOR: lua: Properly check negative offset in Channel/HttpMessage functions
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 13 Aug 2021 06:11:00 +0000 (08:11 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 13 Aug 2021 06:36:42 +0000 (08:36 +0200)
commit70c4345dbc19c2e304d8d481ccb391990b61c425
tree95d1a870c6e22f87b7b9f6ef4cf404acd1440e1b
parent24e7f354e9ccf292eb4404e7e50b87b5b0a61ccd
BUG/MINOR: lua: Properly check negative offset in Channel/HttpMessage functions

In Channel and HTTPMessage classes, several functions uses an offset that
may be negative to start from the end of incoming data. But, after
calculation, the offset must never be negative. However, there is a bug
because of a bad cast to unsigned when "input + offset" is performed. The
result must be a signed integer.

This patch should fix most of defects reported in the issue #1347. It only
affects 2.5-dev. No backport needed.
src/hlua.c