BUG/MINOR: lua: Add missing string length for lua sticktable lookup

In hlua_stktable_lookup(), the key length is never set so all
stktable:lookup("key") calls return nil from lua.

This patch must be backported as far as 1.9.

[Cf: I slightly updated the patch to use lua_tolstring() instead of
     luaL_checkstring() + strlen()]
This commit is contained in:
Nathan Neulinger 2020-03-03 20:32:47 -06:00 committed by Christopher Faulet
parent 3d5e121842
commit 31a841c323

View File

@ -617,7 +617,7 @@ int hlua_stktable_lookup(lua_State *L)
t = hlua_check_stktable(L, 1);
smp.data.type = SMP_T_STR;
smp.flags = SMP_F_CONST;
smp.data.u.str.area = (char *)luaL_checkstring(L, 2);
smp.data.u.str.area = (char *)lua_tolstring(L, 2, &smp.data.u.str.data);
skey = smp_to_stkey(&smp, t);
if (!skey) {