From d9659d4b369d305cde3bc8b59e4df7e572df8834 Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Sun, 16 Feb 2014 16:15:14 +0100 Subject: [PATCH] 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 --- src/wayland/meta-wayland-surface.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index e5995d366..d2075eeac 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -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,