]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: hlua: add check for lua_newstate
authorfirexinghe <xingheyd@163.com>
Thu, 13 Jul 2023 03:03:34 +0000 (11:03 +0800)
committerWilly Tarreau <w@1wt.eu>
Wed, 19 Jul 2023 08:16:14 +0000 (10:16 +0200)
commitbfff46f4112d978c0311ce57e0c90866994dac3e
tree45e4a40c45fadaedb55ee1f2eeba42f6a041b0e0
parentc0456f45c8aa3173a503dc8d4cd0d4e4f1b29a3b
BUG/MINOR: hlua: add check for lua_newstate

Calling lual_newstate(Init main lua stack) in the hlua_init_state()
function, the return value of lua_newstate() may be NULL (for example
in case of OOM). In this case, L will be NULL, and then crash happens
in lua_getextraspace(). So, we add a check for lua_newstate.

This should be backported at least to 2.4, maybe further.
src/hlua.c