[gnome-settings-daemon/wip/hadess/fix-media-keys-migration-crash: 1/2] media-keys: Fix crash on key bindings migration



commit 0e56f943290295a0d4f2a560479fd57deeeabe19
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 7856c454..205455ec 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -3222,7 +3222,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]