mirror of
https://github.com/OISF/suricata.git
synced 2026-10-11 22:09:53 +00:00
lua: validate signature argument to bytevar.map
bytevar.map() read its first argument as a Signature pointer. Dereferencing the full userdata stopped the engine at rule load. The commit provides a more intuitive user message when the user provides full user data.
This commit is contained in:
committed by
Victor Julien
parent
c8ac53c95b
commit
59358d6967
@@ -38,6 +38,9 @@ static DetectLuaData *GetLuaData(lua_State *luastate)
|
||||
|
||||
static int LuaBytevarMap(lua_State *L)
|
||||
{
|
||||
if (!lua_islightuserdata(L, -2)) {
|
||||
return luaL_error(L, "bytevar.map: first argument must be the signature passed to init");
|
||||
}
|
||||
const Signature *s = lua_touserdata(L, -2);
|
||||
const char *name = luaL_checkstring(L, -1);
|
||||
DetectLuaData *ld = GetLuaData(L);
|
||||
|
||||
Reference in New Issue
Block a user