GDBusConnection: Avoid dereferencing vtable for unregistered objects
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 19 Mar 2012 19:13:24 +0000 (20:13 +0100)
committerDavid Zeuthen <davidz@redhat.com>
Mon, 19 Mar 2012 21:12:00 +0000 (17:12 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=671988

Signed-off-by: David Zeuthen <davidz@redhat.com>
gio/gdbusconnection.c

index 5f85e40..44bda5d 100644 (file)
@@ -4663,9 +4663,6 @@ call_in_idle_cb (gpointer user_data)
   guint registration_id;
   guint subtree_registration_id;
 
-  vtable = g_object_get_data (G_OBJECT (invocation), "g-dbus-interface-vtable");
-  g_assert (vtable != NULL && vtable->method_call != NULL);
-
   registration_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (invocation), "g-dbus-registration-id"));
   subtree_registration_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (invocation), "g-dbus-subtree-registration-id"));
 
@@ -4684,6 +4681,9 @@ call_in_idle_cb (gpointer user_data)
       goto out;
     }
 
+  vtable = g_object_get_data (G_OBJECT (invocation), "g-dbus-interface-vtable");
+  g_assert (vtable != NULL && vtable->method_call != NULL);
+
   vtable->method_call (g_dbus_method_invocation_get_connection (invocation),
                        g_dbus_method_invocation_get_sender (invocation),
                        g_dbus_method_invocation_get_object_path (invocation),