[gtk/wip/carlosg/tablet-invalid-reads-master: 1/2] gdk: Fix wl_output accounting on tablet devices



commit f354a7787a6b35664cc9dcb5e5e0a9b065f78442
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Oct 8 17:46:38 2019 +0200

    gdk: Fix wl_output accounting on tablet devices
    
    The code managing this accounting mixed seat and tablet output lists,
    can't bode well. Fixes invalid reads on list elements, as there are
    dangling pointers.
    
    Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2157

 gdk/wayland/gdkdevice-wayland.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index d90d133321..7a7031d882 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -4490,7 +4490,7 @@ pointer_surface_enter (void              *data,
   if (tablet)
     {
       tablet->pointer_info.pointer_surface_outputs =
-        g_slist_append (seat->pointer_info.pointer_surface_outputs, output);
+        g_slist_append (tablet->pointer_info.pointer_surface_outputs, output);
     }
   else
     {
@@ -4519,7 +4519,7 @@ pointer_surface_leave (void              *data,
   if (tablet)
     {
       tablet->pointer_info.pointer_surface_outputs =
-        g_slist_remove (seat->pointer_info.pointer_surface_outputs, output);
+        g_slist_remove (tablet->pointer_info.pointer_surface_outputs, output);
     }
   else
     {


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