]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: hlua: don't use lua_pushfstring() when we don't expect LJMP
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 3 Jun 2024 21:18:24 +0000 (23:18 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Tue, 4 Jun 2024 14:31:01 +0000 (16:31 +0200)
commitc0a3c1281fac10ca7a590a4c34d102c8040e97a5
tree5bafe706b7157552e33de3f081b9d34dff68741c
parent6e484996c6e3e5d7fc35fef77333b4f64d514fcb
BUG/MINOR: hlua: don't use lua_pushfstring() when we don't expect LJMP

lua_pushfstring() is used in multiple cleanup paths (upon error) to
push the error message that will be raised by lua_error(). However this
is often done from an unprotected environment, or in the middle of a
cleanup sequence, thus we don't want the function to LJMP! (it may cause
various issues ranging from memory leaks to crashing the process..)

Hopefully this has very few chances of happening but since the use of
lua_pushfstring() is limited to error reporting here, it's ok to use our
own hlua_pushfstring_safe() implementation with a little overhead to
ensure that the function will never LJMP.

This could be backported to all stable versions.
src/hlua.c