From: Bastien Nocera Date: Mon, 16 Dec 2013 16:21:41 +0000 (+0100) Subject: gdbus-codegen: Fix crasher in goa-using apps X-Git-Tag: 2.39.3~134 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c300079f1320b8522a4885987fd2443c171ec629;p=platform%2Fupstream%2Fglib.git 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 --- diff --git a/gio/gdbus-2.0/codegen/codegen.py b/gio/gdbus-2.0/codegen/codegen.py index e72cb31..c711d44 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))