]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: lua: in some case a sample may remain undefined
authorThierry FOURNIER <tfournier@arpalert.org>
Wed, 26 Aug 2015 12:19:03 +0000 (14:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 27 Aug 2015 09:31:02 +0000 (11:31 +0200)
When we transform a top stack entry in sample, the empty stack case
is not handled. This patch fix this behavior.

src/hlua.c

index 5357b32fdec293e1c11848308c17b60a85c085f9..f7ce3a5c11ae1c54d00791556ebb148d8caab5d2 100644 (file)
@@ -508,6 +508,8 @@ static int hlua_lua2smp(lua_State *L, int ud, struct sample *smp)
        case LUA_TFUNCTION:
        case LUA_TTHREAD:
        case LUA_TLIGHTUSERDATA:
+       case LUA_TNONE:
+       default:
                smp->data.type = SMP_T_BOOL;
                smp->data.u.sint = 0;
                break;