]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hlua: Don't forget the return statement after a hlua_yieldk()
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 11 Jun 2025 19:39:19 +0000 (21:39 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Jun 2025 06:46:36 +0000 (08:46 +0200)
In hlua_applet_tcp_getline_yield(), the function may yield if there is no
data available. However we must take care to add a return statement just
after the call to hlua_yieldk(). I don't know the details of the LUA API,
but at least, this return statement fix a build error about uninitialized
variables that may be used.

It is a 3.3-specific issue. No backport needed.

src/hlua.c

index 4a3a76f7e771004819e091476df103c82061462c..b1c2fa4df7c6d0bf23cff767026a739fa70173e1 100644 (file)
@@ -5312,6 +5312,7 @@ __LJMP static int hlua_applet_tcp_getline_yield(lua_State *L, int status, lua_KC
        if (ret == 0) {
                applet_need_more_data(luactx->appctx);
                MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_applet_tcp_getline_yield, TICK_ETERNITY, 0));
+               return 0;
        }
 
        /* End of data: commit the total strings and return. */