From 33d4100ea0740acbd5002d340c1eba268f55ed94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=96=9F=20=E2=96=96=E2=96=9F=20=E2=96=96?= Date: Thu, 2 Apr 2015 01:10:16 +0200 Subject: [PATCH] prevent segfault when dbus signal creation failed --- dbus.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dbus.c b/dbus.c index 7f5527382..569160311 100644 --- a/dbus.c +++ b/dbus.c @@ -819,6 +819,10 @@ luaA_dbus_emit_signal(lua_State *L) const char *name = luaL_checkstring(L, 4); DBusConnection *dbus_connection = a_dbus_bus_getbyname(bus_name); DBusMessage* msg = dbus_message_new_signal(path, itface, name); + if (msg == NULL) { + luaA_warn(L, "your D-Bus signal emitting method error'd"); + return 0; + } DBusMessageIter iter; dbus_message_iter_init_append(msg, &iter);