]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util-lua-common: use lua_pushinteger w/ int values
authorJuliana Fajardini <jufajardini@gmail.com>
Mon, 26 Jul 2021 12:24:02 +0000 (13:24 +0100)
committerShivani Bhardwaj <shivanib134@gmail.com>
Mon, 27 Sep 2021 06:42:41 +0000 (12:12 +0530)
replace lua_pushnumber with lua_pushinteger for SCFlowStats and
SCRuleIds.

(cherry picked from commit 9b6ce274877ca825dbcbda0a7e540660004b5390)

src/util-lua-common.c

index 2477ffc2ad09b484fe8eda1676abf877b3fb5ccf..38140bbb29acfd95e1ff8b43aa8e87a294a19bdf 100644 (file)
@@ -493,9 +493,9 @@ static int LuaCallbackAppLayerProtoFlow(lua_State *luastate)
  */
 static int LuaCallbackStatsPushToStackFromFlow(lua_State *luastate, const Flow *f)
 {
-    lua_pushnumber(luastate, f->todstpktcnt);
+    lua_pushinteger(luastate, f->todstpktcnt);
     lua_pushnumber(luastate, f->todstbytecnt);
-    lua_pushnumber(luastate, f->tosrcpktcnt);
+    lua_pushinteger(luastate, f->tosrcpktcnt);
     lua_pushnumber(luastate, f->tosrcbytecnt);
     return 4;
 }
@@ -557,9 +557,9 @@ static int LuaCallbackFlowId(lua_State *luastate)
  */
 static int LuaCallbackRuleIdsPushToStackFromPacketAlert(lua_State *luastate, const PacketAlert *pa)
 {
-    lua_pushnumber (luastate, pa->s->id);
-    lua_pushnumber (luastate, pa->s->rev);
-    lua_pushnumber (luastate, pa->s->gid);
+    lua_pushinteger(luastate, pa->s->id);
+    lua_pushinteger(luastate, pa->s->rev);
+    lua_pushinteger(luastate, pa->s->gid);
     return 3;
 }