From c300079f1320b8522a4885987fd2443c171ec629 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 16 Dec 2013 17:21:41 +0100 Subject: [PATCH] gdbus-codegen: Fix crasher in goa-using apps When replacing a version of goa-daemon (from gnome-online-accounts) by a newer version with some added interfaces, evolution-data-server and the gvfs-goa volume monitor might crash as there's no interface definition for this new interface. Work-around this by returning earlier from the _notify() implementation, rather than accessing invalid memory. https://bugzilla.gnome.org/show_bug.cgi?id=720539 --- gio/gdbus-2.0/codegen/codegen.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gio/gdbus-2.0/codegen/codegen.py b/gio/gdbus-2.0/codegen/codegen.py index e72cb317e..c711d4423 100644 --- a/gio/gdbus-2.0/codegen/codegen.py +++ b/gio/gdbus-2.0/codegen/codegen.py @@ -2768,7 +2768,12 @@ class CodeGenerator: self.c.write('static void\n' '%sobject_notify (GDBusObject *object, GDBusInterface *interface)\n' '{\n' - ' g_object_notify (G_OBJECT (object), ((_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface))->hyphen_name);\n' + ' _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);\n' + ' /* info can be NULL if the other end is using a D-Bus interface we don\'t know\n' + ' * anything about, for example old generated code in this process talking to\n' + ' * newer generated code in the other process. */\n' + ' if (info != NULL)\n' + ' g_object_notify (G_OBJECT (object), info->hyphen_name);\n' '}\n' '\n' %(self.ns_lower))