lua: clear stack after each script run

pull/682/head
Victor Julien 11 years ago
parent ae69a4a024
commit 86b299d06c

@ -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)

Loading…
Cancel
Save