projects
/
profile
/
ivi
/
murphy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb72a9f
)
lua-decision: don't crash in table/select constructor if arg is not table.
author
Janos Kovacs
<jankovac503@gmail.com>
Fri, 13 Dec 2013 12:35:42 +0000
(14:35 +0200)
committer
Krisztian Litkey
<kli@iki.fi>
Fri, 13 Dec 2013 12:35:42 +0000
(14:35 +0200)
src/core/lua-decision/mdb.c
patch
|
blob
|
history
diff --git
a/src/core/lua-decision/mdb.c
b/src/core/lua-decision/mdb.c
index
23d02bb
..
763c210
100644
(file)
--- a/
src/core/lua-decision/mdb.c
+++ b/
src/core/lua-decision/mdb.c
@@
-403,6
+403,9
@@
static int table_create_from_lua(lua_State *L)
MRP_LUA_ENTER;
+ if (!lua_istable(L, 2))
+ luaL_error(L, "expecting table as argument");
+
tbl = (mrp_lua_mdb_table_t *)mrp_lua_create_object(L, TABLE_CLASS, NULL,0);
tbl->builtin = true;
@@
-925,6
+928,9
@@
static int select_create_from_lua(lua_State *L)
MRP_LUA_ENTER;
+ if (!lua_istable(L, 2))
+ luaL_error(L, "expecting table as argument");
+
sel = (mrp_lua_mdb_select_t *)mrp_lua_create_object(L,SELECT_CLASS,NULL,0);
MRP_LUA_FOREACH_FIELD(L, 2, fldnam, fldnamlen) {