]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
lua/bytevarlib: return luaL_error to suppress warning
authorJason Ish <jason.ish@oisf.net>
Mon, 21 Jul 2025 20:50:20 +0000 (14:50 -0600)
committerJason Ish <jason.ish@oisf.net>
Fri, 1 Aug 2025 16:54:17 +0000 (10:54 -0600)
Even though luaL_error never returns, use a return to make it
clear. Also prevents a compiler warning about idx being used
uninitialized.

src/util-lua-bytevarlib.c

index bea9a4ce948108d08fe709f5bcbc144594d619a7..8564f9466751b1fdf21807c83a44cdbf5ac6c339 100644 (file)
@@ -56,7 +56,7 @@ static int LuaBytevarMap(lua_State *L)
 
     DetectByteIndexType idx;
     if (!DetectByteRetrieveSMVar(name, s, -1, &idx)) {
-        luaL_error(L, "unknown byte_extract or byte_math variable: %s", name);
+        return luaL_error(L, "unknown byte_extract or byte_math variable: %s", name);
     }
 
     ld->bytevar[ld->bytevars].name = SCStrdup(name);