1
0
mirror of https://github.com/tmux/tmux.git synced 2025-04-10 02:58:50 +00:00

Error on invalid modifier keys.

This commit is contained in:
nicm 2016-11-23 16:44:42 +00:00
parent 3cf19d6dd0
commit 24916f2f6e

View File

@ -140,6 +140,9 @@ key_string_get_modifiers(const char **string)
case 's': case 's':
modifiers |= KEYC_SHIFT; modifiers |= KEYC_SHIFT;
break; break;
default:
*string = NULL;
return 0;
} }
*string += 2; *string += 2;
} }
@ -179,7 +182,7 @@ key_string_lookup_string(const char *string)
string++; string++;
} }
modifiers |= key_string_get_modifiers(&string); modifiers |= key_string_get_modifiers(&string);
if (string[0] == '\0') if (string == NULL || string[0] == '\0')
return (KEYC_UNKNOWN); return (KEYC_UNKNOWN);
/* Is this a standard ASCII key? */ /* Is this a standard ASCII key? */