]> _ Git - termbox2.git/commit
fix bug in `extract_esc_cap`.
authorAdam Saponara <as@php.net>
Thu, 6 Jan 2022 06:06:30 +0000 (01:06 -0500)
committerAdam Saponara <as@php.net>
Thu, 6 Jan 2022 06:06:30 +0000 (01:06 -0500)
commitf71521477076741b6d7a9dbeb365a7103c2c9ae9
treed30018ec74f6aa56f060bb791d11e4d8b5fcaa28
parent79a9c2c3402424ccc622e2e4d6c6f3eca7d88b2b
fix bug in `extract_esc_cap`.

previously we were able to read past the actual end of the
input buffer (`global.in.buf`). we would not segfault due
to how bytebufs are implemented, but we could erroneously
re-process segments of input. in practice i think this
could only occur with an instantaneous burst of tty input
greater than the read buffer in `wait_event` (64 bytes). i
noticed this by accidentally mouse-wheeling very fast in
xfce4-terminal which, in my setup, sends a bunch of
up-arrow events (`\x1bOA`) all at once, in which case
termbox was pseduo-randomly emitting "O" and "A" events.
termbox.h