]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: httpclient/lua: misplaced luaL_buffinit()
authorWilliam Lallemand <wlallemand@haproxy.org>
Tue, 2 Nov 2021 09:40:06 +0000 (10:40 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 2 Nov 2021 09:40:06 +0000 (10:40 +0100)
Some luaL_buffinit() call was done before the push of the variable name,
where it seems to work correctly with lua < 5.4.3, it brokes
systematically on this version.

This patch inverts the pushstring and the buffinit.

src/hlua.c

index 435455bfa7765ec67e3e8471efd31cbef6fcdac1..e9d4391f77ab9b7100b3e1a5c04a0706f742a2dd 100644 (file)
@@ -7200,8 +7200,8 @@ rcv:
        /* we return a "res" object */
        lua_newtable(L);
 
-       luaL_buffinit(L, &hlua_hc->b);
        lua_pushstring(L, "body");
+       luaL_buffinit(L, &hlua_hc->b);
 
        MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_httpclient_rcv_yield, TICK_ETERNITY, 0));