From 8da6a20f27e9aa3a82756b1a0cf50c10e7b1bb20 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 22 Aug 2009 13:20:55 +0200 Subject: [PATCH] luaobject: check that object is userdata Signed-off-by: Julien Danjou --- common/luaobject.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/luaobject.c b/common/luaobject.c index 7e4283c8..10a95979 100644 --- a/common/luaobject.c +++ b/common/luaobject.c @@ -224,6 +224,8 @@ luaA_object_emit_signal(lua_State *L, int oud, { int oud_abs = luaA_absindex(L, oud); lua_object_t *obj = lua_touserdata(L, oud); + if(!obj) + luaL_error(L, "trying to emit signal on non-object"); signal_t *sigfound = signal_array_getbyid(&obj->signals, a_strhash((const unsigned char *) name)); if(sigfound)