diff options
author | Ran Benita <ran234@gmail.com> | 2018-03-12 09:43:55 +0200 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2018-07-30 10:35:10 +0300 |
commit | 842e4351c2c97de6051cab6ce36b4a81e709a0e1 (patch) | |
tree | 53193b57b6d379a04a7b110592e840fc898e5dd3 /src/compose | |
parent | 917636b1d0d70205a13f89062b95e3a0fc31d4ff (diff) | |
download | xorg-lib-libxkbcommon-842e4351c2c97de6051cab6ce36b4a81e709a0e1.tar.gz |
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>
Diffstat (limited to 'src/compose')
-rw-r--r-- | src/compose/parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compose/parser.c b/src/compose/parser.c index 40c9470..439d404 100644 --- a/src/compose/parser.c +++ b/src/compose/parser.c @@ -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"); |