diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-09-03 06:26:48 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-09-03 06:26:48 +0000 |
commit | 473911fb731eb740d1c468350eda334638902d94 (patch) | |
tree | 7cf69cec07e91d0b1ad45e5cb07e2d7f71924cce /tty-keys.c | |
parent | 84a4007b06adf2df5aa5e115b5a24a155819eb37 (diff) | |
download | rtmux-473911fb731eb740d1c468350eda334638902d94.tar.gz rtmux-473911fb731eb740d1c468350eda334638902d94.tar.bz2 rtmux-473911fb731eb740d1c468350eda334638902d94.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 'tty-keys.c')
-rw-r--r-- | tty-keys.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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. */ |