mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
The lexer fails to end a valid token when the lookahead character is
beyond '\x7F'. For instance, input
true\xC2\xA2
produces the tokens
JSON_ERROR true\xC2
JSON_ERROR \xA2
This should be
JSON_KEYWORD true
JSON_ERROR \xC2
JSON_ERROR \xA2
instead.
The culprit is
#define TERMINAL(state) [0 ... 0x7F] = (state)
It leaves [0x80..0xFF] zero, i.e. IN_ERROR. Has always been broken.
Fix it to initialize the complete array.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180831075841.13363-2-armbru@redhat.com>
|
||
|---|---|---|
| .. | ||
| block-qdict.c | ||
| json-lexer.c | ||
| json-parser-int.h | ||
| json-parser.c | ||
| json-streamer.c | ||
| Makefile.objs | ||
| qbool.c | ||
| qdict.c | ||
| qjson.c | ||
| qlist.c | ||
| qlit.c | ||
| qnull.c | ||
| qnum.c | ||
| qobject.c | ||
| qstring.c | ||