compose: fix infinite loop in parser on some inputs
The parser would enter an infinite loop if an unterminated keysym literal occurs at EOF. Found with the afl fuzzer. Signed-off-by: Ran Benita <ran234@gmail.com>master
parent
917636b1d0
commit
842e4351c2
|
@ -144,7 +144,7 @@ skip_more_whitespace_and_comments:
|
|||
|
||||
/* LHS Keysym. */
|
||||
if (chr(s, '<')) {
|
||||
while (peek(s) != '>' && !eol(s))
|
||||
while (peek(s) != '>' && !eol(s) && !eof(s))
|
||||
buf_append(s, next(s));
|
||||
if (!chr(s, '>')) {
|
||||
scanner_err(s, "unterminated keysym literal");
|
||||
|
|
Loading…
Reference in New Issue