keybindings: Avoid using unitialized memory and grabbing random keys
meta_parse_accelerator() considers 0 length accelerator strings as valid, meaning that the keybinding should be disabled. Unfortunately, it doesn't initialize the MetaKeyCombo so if the caller doesn't initialize it either, we end up using random values and possibly grabbing random keys. https://bugzilla.gnome.org/show_bug.cgi?id=766270
This commit is contained in:
@ -1379,8 +1379,8 @@ meta_display_grab_accelerator (MetaDisplay *display,
|
||||
MetaKeyBindingManager *keys = &display->key_binding_manager;
|
||||
MetaKeyBinding *binding;
|
||||
MetaKeyGrab *grab;
|
||||
MetaKeyCombo combo;
|
||||
MetaResolvedKeyCombo resolved_combo;
|
||||
MetaKeyCombo combo = { 0 };
|
||||
MetaResolvedKeyCombo resolved_combo = { 0 };
|
||||
|
||||
if (!meta_parse_accelerator (accelerator, &combo))
|
||||
{
|
||||
|
Reference in New Issue
Block a user