summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2019-11-16 11:43:49 +0100
committerBastien Nocera <hadess@hadess.net>2019-11-16 11:43:49 +0100
commit0e56f943290295a0d4f2a560479fd57deeeabe19 (patch)
tree07c940abcf1e8169a4781129bcd9c8a126775580
parentcd051e6c7ccfb7e7b0ec440409c559b2e51284e8 (diff)
downloadgnome-settings-daemon-0e56f943290295a0d4f2a560479fd57deeeabe19.tar.gz
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
-rw-r--r--plugins/media-keys/gsd-media-keys-manager.c2
1 files changed, 1 insertions, 1 deletions
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);