summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty-keys.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-09-03 06:26:48 +0000
committernicm <nicm@openbsd.org>2012-09-03 06:26:48 +0000
commitb02d69f2b63716904ddeeababe8f45c661172e71 (patch)
tree1158df0522dfee82d5763ab3a66f0d717c91e8ec /usr.bin/tmux/tty-keys.c
parentroll a comment to a new line, so that the comment-stripper can remove it (diff)
downloadwireguard-openbsd-b02d69f2b63716904ddeeababe8f45c661172e71.tar.xz
wireguard-openbsd-b02d69f2b63716904ddeeababe8f45c661172e71.zip
Can't call evtimer_pending on uninitialized events, call
evtimer_initialized first. Reported by Vladimir Lomov, fix from Thomas Adam slightly modified by me.
Diffstat (limited to 'usr.bin/tmux/tty-keys.c')
-rw-r--r--usr.bin/tmux/tty-keys.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c
index 8057a199987..b8014c7bd5e 100644
--- a/usr.bin/tmux/tty-keys.c
+++ b/usr.bin/tmux/tty-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-keys.c,v 1.43 2012/08/21 10:08:11 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.44 2012/09/03 06:26:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -533,6 +533,7 @@ partial_key:
* timer has expired, give up waiting and send the escape.
*/
if ((tty->flags & TTY_ESCAPE) &&
+ evtimer_initialized(&tty->key_timer) &&
!evtimer_pending(&tty->key_timer, NULL)) {
evbuffer_drain(tty->event->input, 1);
key = '\033';
@@ -543,7 +544,8 @@ partial_key:
start_timer:
/* If already waiting for timer, do nothing. */
- if (evtimer_pending(&tty->key_timer, NULL))
+ if (evtimer_initialized(&tty->key_timer) &&
+ evtimer_pending(&tty->key_timer, NULL))
return (0);
/* Start the timer and wait for expiry or more data. */