summaryrefslogtreecommitdiffstats
path: root/tty-keys.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-09-03 06:26:48 +0000
committerThomas Adam <thomas@xteddy.org>2012-09-04 22:35:52 +0100
commitd6066552ee606875e95799288819ec9f63cf09c5 (patch)
tree05d75972ab502e482f6d3e6fdaafa518694c67c7 /tty-keys.c
parentc06b2e4fb9e322824404edab3651e4d9473adde8 (diff)
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 'tty-keys.c')
-rw-r--r--tty-keys.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tty-keys.c b/tty-keys.c
index a4128714..de574f4f 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -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. */