]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: lua: error in detection of mandatory arguments
authorThierry FOURNIER <tfournier@haproxy.com>
Fri, 13 Mar 2015 11:21:07 +0000 (12:21 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 13 Mar 2015 13:10:33 +0000 (14:10 +0100)
The last mandatory arguments in sample fetches or converters are
ignored. This is due to a bad control.

src/hlua.c

index d1086c724195a624de4fd7db6301d83dbb4bca82..1c239e52196e9eba43783d490078a7cdccd51f08 100644 (file)
@@ -530,7 +530,7 @@ __LJMP int hlua_lua2arg_check(lua_State *L, int first, struct arg *argp,
 
                /* Check for mandatory arguments. */
                if (argp[idx].type == ARGT_STOP) {
-                       if (idx + 1 < min_arg)
+                       if (idx < min_arg)
                                WILL_LJMP(luaL_argerror(L, first + idx, "Mandatory argument expected"));
                        return 0;
                }