From: Jason Ish Date: Fri, 24 May 2024 21:26:19 +0000 (-0600) Subject: lua: reset instruction counter before calling script X-Git-Tag: suricata-8.0.0-beta1~1260 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afb705d27843da0657c355d1d012c41297d8c063;p=thirdparty%2Fsuricata.git lua: reset instruction counter before calling script --- diff --git a/src/detect-lua.c b/src/detect-lua.c index cab93693d4..7e2343d07c 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -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