]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: lua: converters doesn't work
authorThierry Fournier <thierry.fournier@ozon.io>
Fri, 27 May 2016 14:35:01 +0000 (16:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 8 Jun 2016 08:33:27 +0000 (10:33 +0200)
The number of arguments pushed in the stack are false, so we try to execute a
function out of the stack. This function is always a nil pointer, so the
following message is displayed.

   Lua converter 'testconv': runtime error: attempt to call a nil value.

Thanks Michael Ezzell for the repporting.

This patch must be backported in the 1.6 version.

src/hlua.c

index 94f97429c8950a92e9f78f473e22102e51ffee05..953c219bdf89fd8b6d17e950d6b638dac41689c6 100644 (file)
@@ -5163,7 +5163,7 @@ static int hlua_sample_conv_wrapper(const struct arg *arg_p, struct sample *smp,
                        return 0;
                }
                hlua_smp2lua(stream->hlua.T, smp);
-               stream->hlua.nargs = 2;
+               stream->hlua.nargs = 1;
 
                /* push keywords in the stack. */
                if (arg_p) {