BUG/MEDIUM: lua: fix argument handling in data removal functions
authorBoyang Li <psbchina@icloud.com>
Tue, 10 May 2022 17:47:23 +0000 (17:47 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 13 May 2022 06:40:03 +0000 (08:40 +0200)
commite0c5435d763b33b3951876e867eb58ddb9950251
treeec67aae5cf0ce33613d01107a1a562df63023e77
parenteeeeed44eac852a6e4a7744c1f92dbd584ca4f45
BUG/MEDIUM: lua: fix argument handling in data removal functions

Lua API Channel.remove() and HTTPMessage.remove() expects 1 to 3
arguments (counting the manipulated object), with offset and length
being the 2nd and 3rd argument, respectively.

hlua_{channel,http_msg}_del_data() incorrectly gets the 3rd argument as
offset, and 4th (nonexistent) as length. hlua_http_msg_del_data() also
improperly checks arguments. This patch fixes argument handling in both.

Must be backported to 2.5.
src/hlua.c