qemu-cr16/include
Markus Armbruster f9277915ee json: Fix streamer not to ignore trailing unterminated structures
json_message_process_token() accumulates tokens until it got the
sequence of tokens that comprise a single JSON value (it counts curly
braces and square brackets to decide).  It feeds those token sequences
to json_parser_parse().  If a non-empty sequence of tokens remains at
the end of the parse, it's silently ignored.  check-qjson.c cases
unterminated_array(), unterminated_array_comma(), unterminated_dict(),
unterminated_dict_comma() demonstrate this bug.

Fix as follows.  Introduce a JSON_END_OF_INPUT token.  When the
streamer receives it, it feeds the accumulated tokens to
json_parser_parse().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180823164025.12553-46-armbru@redhat.com>
2018-08-24 20:26:37 +02:00
..
block
chardev
crypto
disas
exec
fpu
hw
io
libdecnumber
migration
monitor
net
qapi json: Fix streamer not to ignore trailing unterminated structures 2018-08-24 20:26:37 +02:00
qemu json: Reject invalid UTF-8 sequences 2018-08-24 20:26:37 +02:00
qom
scsi
standard-headers
sysemu
ui
elf.h
glib-compat.h
qemu-common.h
qemu-io.h
trace-tcg.h