wayland-surface: Don't crash when someone tries to run a native app using old gtk

This ends up calling set_dbus_properties with a NULL
window, instead of segfaulting the compositor return so that the broken
app dies instead.

https://bugzilla.gnome.org/show_bug.cgi?id=724472
This commit is contained in:
Adel Gadllah 2014-02-16 16:15:14 +01:00
parent d043d9943b
commit d9659d4b36

View File

@ -1113,6 +1113,13 @@ set_dbus_properties (struct wl_client *client,
MetaWaylandSurfaceExtension *gtk_surface = wl_resource_get_user_data (resource);
MetaWaylandSurface *surface = wl_container_of (gtk_surface, surface, gtk_surface);
/* Broken client, let it die instead of us */
if (!surface->window)
{
meta_warning ("meta-wayland-surface: set_dbus_properties called with invalid window!\n");
return;
}
meta_window_set_gtk_dbus_properties (surface->window,
application_id,
unique_bus_name,