From 1315cb793b884140b51e9934ebbdc7493be22db5 Mon Sep 17 00:00:00 2001 From: Juliana Fajardini Date: Tue, 14 Sep 2021 09:49:07 +0100 Subject: [PATCH] util/lua-common: fix SCFileInfo bug & doc comment The callback for FileInfo was returning the wrong value, resulting in loss of some tuple values for one calling SCFileInfo in a script. The documentation comment wasn't mentioning the sha items that are pushed. --- src/util-lua-common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util-lua-common.c b/src/util-lua-common.c index 7520d6148b..833e47b714 100644 --- a/src/util-lua-common.c +++ b/src/util-lua-common.c @@ -750,7 +750,8 @@ static int LuaCallbackLogError(lua_State *luastate) * \retval cnt number of data items placed on the stack * * Places: fileid (number), txid (number), name (string), - * size (number), magic (string), md5 in hex (string) + * size (number), magic (string), md5 in hex (string), + * sha1 (string), sha256 (string) */ static int LuaCallbackFileInfoPushToStackFromFile(lua_State *luastate, const File *file) { @@ -803,7 +804,7 @@ static int LuaCallbackFileInfoPushToStackFromFile(lua_State *luastate, const Fil lua_pushstring(luastate, md5ptr); lua_pushstring(luastate, sha1ptr); lua_pushstring(luastate, sha256ptr); - return 6; + return 8; } /** \internal -- 2.47.2