]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: lua: In error case, the safe mode is not removed
authorThierry FOURNIER <thierry.fournier@ozon.io>
Wed, 12 Jul 2017 09:18:00 +0000 (11:18 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 18 Jul 2017 04:41:19 +0000 (06:41 +0200)
Just forgot of reset the safe mode. This have not consequences
the safe mode just set a pointer on fucntion which is called only
and initialises a longjmp.

Out of lua execution, this longjmp is never executed and the
function is never called.

This patch should be backported in 1.6 and 1.7

src/hlua.c

index 85e0c664ea85f5cde8660bdb44cf971ba3dd54b5..408a9f26657ebb34520dc24f11be0fa6f357f02b 100644 (file)
@@ -857,6 +857,7 @@ int hlua_ctx_init(struct hlua *lua, struct task *task)
        lua->T = lua_newthread(gL.T);
        if (!lua->T) {
                lua->Tref = LUA_REFNIL;
+               RESET_SAFE_LJMP(gL.T);
                return 0;
        }
        hlua_sethlua(lua);