projects
/
project
/
libubox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix stack overflow bug of uloop lua binding.
[project/libubox.git]
/
lua
/
uloop.c
diff --git
a/lua/uloop.c
b/lua/uloop.c
index
51f53c2
..
5922e04
100644
(file)
--- a/
lua/uloop.c
+++ b/
lua/uloop.c
@@
-43,6
+43,7
@@
static void ul_timer_cb(struct uloop_timeout *t)
lua_getglobal(state, "__uloop_cb");
lua_rawgeti(state, -1, tout->r);
lua_getglobal(state, "__uloop_cb");
lua_rawgeti(state, -1, tout->r);
+ lua_remove(state, -2);
lua_call(state, 0, 0);
}
lua_call(state, 0, 0);
}
@@
-133,6
+134,7
@@
static void ul_process_cb(struct uloop_process *p, int ret)
lua_getglobal(state, "__uloop_cb");
lua_rawgeti(state, -1, proc->r);
luaL_unref(state, -2, proc->r);
lua_getglobal(state, "__uloop_cb");
lua_rawgeti(state, -1, proc->r);
luaL_unref(state, -2, proc->r);
+ lua_remove(state, -2);
lua_pushinteger(state, ret >> 8);
lua_call(state, 1, 0);
}
lua_pushinteger(state, ret >> 8);
lua_call(state, 1, 0);
}