lua: add bounds checks for flowints and flowvars

Ticket: 8556
pull/15412/head
Philippe Antoine 6 months ago committed by Victor Julien
parent e98d419d96
commit 0b239c4848

@ -56,6 +56,9 @@ static int LuaFlowintRegister(lua_State *L)
if (*flowvar_id == 0) {
return luaL_error(L, "failed to register flowvar");
}
if (ld->flowints >= DETECT_LUA_MAX_FLOWINTS) {
return luaL_error(L, "too many flowints registered");
}
ld->flowint[ld->flowints++] = *flowvar_id;
luaL_getmetatable(L, suricata_flowint_mt);

@ -56,6 +56,9 @@ static int LuaFlowvarRegister(lua_State *L)
if (*flowvar_id == 0) {
return luaL_error(L, "failed to register flowvar");
}
if (ld->flowvars >= DETECT_LUA_MAX_FLOWVARS) {
return luaL_error(L, "too many flowvars registered");
}
ld->flowvar[ld->flowvars++] = *flowvar_id;
luaL_getmetatable(L, suricata_flowvar_mt);

Loading…
Cancel
Save