qemu/qobject
Markus Armbruster 2a96042a8d json: Fix lexer for lookahead character beyond '\x7F'
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>
2018-09-24 18:06:09 +02:00
..
block-qdict.c qdict: Make qdict_extract_subqdict() accept dst = NULL 2018-08-15 12:50:39 +02:00
json-lexer.c json: Fix lexer for lookahead character beyond '\x7F' 2018-09-24 18:06:09 +02:00
json-parser-int.h json: Clean up headers 2018-08-24 20:26:37 +02:00
json-parser.c json: Update references to RFC 7159 to RFC 8259 2018-08-24 20:27:14 +02:00
json-streamer.c json: Clean up headers 2018-08-24 20:26:37 +02:00
Makefile.objs qobject: Move block-specific qdict code to block-qdict.c 2018-06-15 14:49:44 +02:00
qbool.c qobject: Drop superfluous includes of qemu-common.h 2018-08-24 20:26:37 +02:00
qdict.c qobject: Move block-specific qdict code to block-qdict.c 2018-06-15 14:49:44 +02:00
qjson.c json: Clean up headers 2018-08-24 20:26:37 +02:00
qlist.c qobject: Drop superfluous includes of qemu-common.h 2018-08-24 20:26:37 +02:00
qlit.c qapi: Replace qobject_to_X(o) by qobject_to(X, o) 2018-03-19 14:58:36 -05:00
qnull.c qobject: Drop superfluous includes of qemu-common.h 2018-08-24 20:26:37 +02:00
qnum.c qobject: Drop superfluous includes of qemu-common.h 2018-08-24 20:26:37 +02:00
qobject.c qobject: Drop superfluous includes of qemu-common.h 2018-08-24 20:26:37 +02:00
qstring.c qobject: Drop superfluous includes of qemu-common.h 2018-08-24 20:26:37 +02:00