summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tty-keys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tty-keys.c b/tty-keys.c
index 99200689..3764421b 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -878,7 +878,7 @@ tty_keys_extended_key(struct tty *tty, const char *buf, size_t len,
}
if (end == len)
return (1);
- if (buf[end] != '~' && buf[end] != 'u')
+ if (end == sizeof tmp || (buf[end] != '~' && buf[end] != 'u'))
return (-1);
/* Copy to the buffer. */