[gtk+] wayland: Protect against NULL offers on gdk_drag_status() implementation



commit 4f6ea16c2e747c32e78285129df4b98b2a80c10d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jan 20 18:55:51 2016 +0100

    wayland: Protect against NULL offers on gdk_drag_status() implementation
    
    If we're called untimely, we might end up crashing here when poking the
    NULL wl_data_offer.

 gdk/wayland/gdkdnd-wayland.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c
index 2787e59..cf2376d 100644
--- a/gdk/wayland/gdkdnd-wayland.c
+++ b/gdk/wayland/gdkdnd-wayland.c
@@ -315,7 +315,7 @@ gdk_wayland_drag_context_drop_finish (GdkDragContext *context,
   selection = gdk_drag_get_selection (context);
   wl_offer = gdk_wayland_selection_get_offer (display, selection);
 
-  if (success && wayland_context->selected_action &&
+  if (wl_offer && success && wayland_context->selected_action &&
       wayland_context->selected_action != GDK_ACTION_ASK)
     {
       gdk_wayland_drag_context_commit_status (context);


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