]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: hlua: prevent LJMP in hlua_traceback()
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 4 Jun 2024 08:41:32 +0000 (10:41 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Tue, 4 Jun 2024 14:31:15 +0000 (16:31 +0200)
commit365ee28510a11993176ffd22704676732c051a4f
treed49089c414d5095ad08d8f85ab5a59a57dbd9aa7
parentf0e5b825cfba3ad710818e46c048ca296978283a
BUG/MINOR: hlua: prevent LJMP in hlua_traceback()

Function is often used on error paths where no precaution is taken
against LJMP. Since the function is used on error paths (which include
out-of-memory error paths) the function lua_getinfo() could also raise
a memory exception, causing the process to crash or improper error
handling if the caller isn't prepared against that eventually. Since the
function is only used on rare events (error handling) and is lacking the
__LJMP prototype pefix, let's make it safe by protecting the lua_getinfo()
call so that hlua_traceback() callers may use it safely now (the function
will always succeed, output will be truncated in case of error).

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