[gnome-settings-daemon/gnome-3-34] media-keys: Fix crash on key bindings migration



commit b6e5de73356723dc29b9622e1c6dcef4835acfad
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Nov 16 11:43:49 2019 +0100

    media-keys: Fix crash on key bindings migration
    
    The loop would add items to the array in an infinite loop as the
    position of the source "pos" never advanced.
    
    Closes: #471

 plugins/media-keys/gsd-media-keys-manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 8cf8d201..60761fa4 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -3220,7 +3220,7 @@ map_keybinding (GVariant *variant, GVariant *old_default, GVariant *new_default)
         }
 
         /* Add all remaining default values */
-        while (*pos)
+        for (; *pos; pos++)
               g_ptr_array_add (array, (gpointer) *pos);
 
         g_ptr_array_add (array, NULL);


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