summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/key-string.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2016-11-23 16:44:43 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2016-11-23 16:44:43 +0000
commitab0f44dad6757a74380109ae62b98708b101801b (patch)
tree3089814fee751e08ea67447c15d9215b5b78efd8 /usr.bin/tmux/key-string.c
parent29b4fd0733ee622822e7dc9e85be5d51cca2905d (diff)
Error on invalid modifier keys.
Diffstat (limited to 'usr.bin/tmux/key-string.c')
-rw-r--r--usr.bin/tmux/key-string.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tmux/key-string.c b/usr.bin/tmux/key-string.c
index bb73590ab83..ba36a49bfad 100644
--- a/usr.bin/tmux/key-string.c
+++ b/usr.bin/tmux/key-string.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key-string.c,v 1.40 2016/10/11 09:30:36 nicm Exp $ */
+/* $OpenBSD: key-string.c,v 1.41 2016/11/23 16:44:42 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -140,6 +140,9 @@ key_string_get_modifiers(const char **string)
case 's':
modifiers |= KEYC_SHIFT;
break;
+ default:
+ *string = NULL;
+ return 0;
}
*string += 2;
}
@@ -179,7 +182,7 @@ key_string_lookup_string(const char *string)
string++;
}
modifiers |= key_string_get_modifiers(&string);
- if (string[0] == '\0')
+ if (string == NULL || string[0] == '\0')
return (KEYC_UNKNOWN);
/* Is this a standard ASCII key? */