mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
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:
parent
3d5e121842
commit
31a841c323
@ -617,7 +617,7 @@ int hlua_stktable_lookup(lua_State *L)
|
|||||||
t = hlua_check_stktable(L, 1);
|
t = hlua_check_stktable(L, 1);
|
||||||
smp.data.type = SMP_T_STR;
|
smp.data.type = SMP_T_STR;
|
||||||
smp.flags = SMP_F_CONST;
|
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);
|
skey = smp_to_stkey(&smp, t);
|
||||||
if (!skey) {
|
if (!skey) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user