summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Marec <frederic.marec@iot.bzh>2019-10-11 16:34:42 +0200
committerFrédéric Marec <frederic.marec@iot.bzh>2019-11-26 13:38:20 +0000
commit4ea033c56ad1e07c82cad570758b7715eefb4f23 (patch)
tree2f1c782a4044f0d799edf0f74f861dd326658749
parent5a5d52285f32811215c2ffce280c2ac55a5b8599 (diff)
Prevent table overflow Bug-AGL: SPEC-2374 Change-Id: Ibce96446735cd0caeeefa91fff57245943023047 Signed-off-by: Frederic Marec <frederic.marec@iot.bzh> (cherry picked from commit b39c6883f7d7d58d60178441c8d408118788418b)
-rw-r--r--ctl-lib/ctl-lua.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c
index 04b4ce9..5509385 100644
--- a/ctl-lib/ctl-lua.c
+++ b/ctl-lib/ctl-lua.c
@@ -492,7 +492,6 @@ static int LuaAfbServiceSync(lua_State* luaState) {
return 1;
}
-
// get source/api/verb+query
const char *api = lua_tostring(luaState, LUA_FIRST_ARG + 1);
const char *verb = lua_tostring(luaState, LUA_FIRST_ARG + 2);
@@ -536,7 +535,7 @@ static int LuaAfbEventPush(lua_State* luaState) {
return 1;
}
- json_object *ctlEventJ = LuaTableToJson(source, luaState, LUA_FIRST_ARG + 2);
+ json_object *ctlEventJ = LuaPopOneArg(source, luaState, LUA_FIRST_ARG + 2);
if (!ctlEventJ) {
lua_pushliteral(luaState, "LuaAfbEventPush: Syntax is AFB:signal ([evtHandle], {lua table})");
lua_error(luaState);