[gnome-shell] st/texture-cache: Fix invalid memory write related to X11 window icons



commit 1b872c119550f2bdf06cc09d7475ed48706dd9c3
Author: Sebastian Keller <skeller gnome org>
Date:   Mon Mar 9 02:17:19 2020 +0100

    st/texture-cache: Fix invalid memory write related to X11 window icons
    
    st_texture_cache_bind_weak_notify calls g_clear_signal_handler which
    then calls st_texture_cache_free_bind. st_texture_cache_free_bind frees
    the bind structure, so by the time g_clear_signal_handler tries to write
    bind->notify_signal_id, bind has already been freed.
    
    Fix this by using g_signal_handler_disconnect instead.
    
    This partially reverts 135d178d08
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/2334

 src/st/st-texture-cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index 758c0215f5..850c0d6979 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -777,7 +777,7 @@ st_texture_cache_bind_weak_notify (gpointer     data,
 {
   StTextureCachePropertyBind *bind = data;
   bind->weakref_active = FALSE;
-  g_clear_signal_handler (&bind->notify_signal_id, bind->source);
+  g_signal_handler_disconnect (bind->source, bind->notify_signal_id);
 }
 
 static void


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