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



commit d9659d4b369d305cde3bc8b59e4df7e572df8834
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Sun Feb 16 16:15:14 2014 +0100

    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 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index e5995d3..d2075ee 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]