From: Willy Tarreau Date: Mon, 6 Apr 2015 08:50:55 +0000 (+0200) Subject: BUG/MAJOR: lua: use correct object size when initializing a new converter X-Git-Tag: v1.6-dev2~286 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08ef3d055d7e67ec08660bb3da2487326f02d704;p=thirdparty%2Fhaproxy.git BUG/MAJOR: lua: use correct object size when initializing a new converter In hlua_converters_new(), we used to allocate the size of an hlua_txn instead of hlua_smp, resulting in random crashes with one integer being randomly overwritten at the end, even when no converter is being used. --- diff --git a/src/hlua.c b/src/hlua.c index c6dcd896e4..d764fa55f5 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -2813,7 +2813,7 @@ static int hlua_converters_new(lua_State *L, struct hlua_txn *txn, int stringsaf * same than the TXN object. */ lua_newtable(L); - hs = lua_newuserdata(L, sizeof(struct hlua_txn)); + hs = lua_newuserdata(L, sizeof(struct hlua_smp)); lua_rawseti(L, -2, 0); hs->s = txn->s;