]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: hlua: _hlua_http_msg_delete incorrect behavior when offset is used
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 28 Sep 2022 17:08:15 +0000 (19:08 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 29 Sep 2022 10:03:04 +0000 (12:03 +0200)
commitbcbcf98e0c0149f91365f1f2d207be018124f6f2
treeb7a459256cb87bb57ba9e5228aabe6f80cd9099b
parent015bbc298ff2eecebba09968b7c3ff41a65b6d12
BUG/MINOR: hlua: _hlua_http_msg_delete incorrect behavior when offset is used

Calling the function with an offset when "offset + len" was superior or equal
to the targeted blk length caused 'v' value to be improperly set.
And because 'v' is directly provided to htx_replace_blk_value(), blk consistency was compromised.
(It seems that blk was overrunning in htx_replace_blk_value() due to
this and header data was overwritten in this case).

This patch adds the missing checks to make the function behave as
expected when offset is set and offset+len is greater or equals to the targeted blk length.
Some comments were added to the function as well.

It may be backported to 2.6 and 2.5
src/hlua.c