From: Victor Julien Date: Wed, 4 Dec 2013 12:15:30 +0000 (+0100) Subject: lua: clear stack after each script run X-Git-Tag: suricata-2.0beta2~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86b299d06c90ffc4285eebd1f85f06d7cf64c68d;p=thirdparty%2Fsuricata.git lua: clear stack after each script run --- diff --git a/src/detect-luajit.c b/src/detect-luajit.c index a88c550bc6..569980dc58 100644 --- a/src/detect-luajit.c +++ b/src/detect-luajit.c @@ -321,6 +321,11 @@ int DetectLuajitMatchBuffer(DetectEngineThreadCtx *det_ctx, Signature *s, SigMat SCLogDebug("no stack"); } + /* clear the stack */ + while (lua_gettop(tluajit->luastate) > 0) { + lua_pop(tluajit->luastate, 1); + } + if (luajit->negated) { if (ret == 1) ret = 0; @@ -457,6 +462,9 @@ static int DetectLuajitMatch (ThreadVars *tv, DetectEngineThreadCtx *det_ctx, lua_pop(tluajit->luastate, 1); } } + while (lua_gettop(tluajit->luastate) > 0) { + lua_pop(tluajit->luastate, 1); + } if (luajit->negated) { if (ret == 1)