]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: hlua: Don't needlessly copy lua strings in trash during args validation
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Aug 2020 06:29:18 +0000 (08:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 7 Aug 2020 12:25:31 +0000 (14:25 +0200)
commitfdea1b6319bc014320a18ba7b7043ba0694dd0dd
tree0a494a3b864c4c84800b266ea8d91107f3dc6e24
parente663a6e326c3d4d465d5aa66e4fbe3acde69aac3
MINOR: hlua: Don't needlessly copy lua strings in trash during args validation

Lua strings are NULL terminated. So in the hlua_lua2arg_check() function, used
to check arguments against the sample fetches specification, there is no reason
to copy these strings in a trash to add a terminating null byte.

In addition, when the array of arguments is built from lua values, we must take
care to count this terminating null bytes in the size of the buffer where a
string is stored. The same must be done when a sample is built from a lua value.

This patch may be backported to easy backports.
src/hlua.c