]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
lua: reset instruction counter before calling script
authorJason Ish <jason.ish@oisf.net>
Fri, 24 May 2024 21:26:19 +0000 (15:26 -0600)
committerJason Ish <jason.ish@oisf.net>
Mon, 27 May 2024 22:00:17 +0000 (16:00 -0600)
src/detect-lua.c

index cab93693d4dcb09f13e927a84927195b6fcb5b5f..7e2343d07c116835debdccaf9154669ec1b96244 100644 (file)
@@ -197,6 +197,9 @@ void LuaDumpStack(lua_State *state)
 static int DetectLuaRunMatch(
         DetectEngineThreadCtx *det_ctx, const DetectLuaData *lua, DetectLuaThreadData *tlua)
 {
+    /* Reset instruction count. */
+    SCLuaSbResetInstructionCounter(tlua->luastate);
+
     if (lua_pcall(tlua->luastate, 1, 1, 0) != 0) {
         if (!(tlua->flags & FLAG_ERROR_LOGGED)) {
             /* Log once per thread, the message from Lua will include