summaryrefslogtreecommitdiffstats
path: root/qobject
diff options
context:
space:
mode:
authorMarkus Armbruster2018-08-23 18:40:13 +0200
committerMarkus Armbruster2018-08-24 20:26:37 +0200
commit5d50113cf675ec96337ac6eaf81d83fbf69273bc (patch)
tree337b5e84e07e0daa38f04408aceccb8a642d94e4 /qobject
parentjson: Fix streamer not to ignore trailing unterminated structures (diff)
downloadqemu-5d50113cf675ec96337ac6eaf81d83fbf69273bc.tar.gz
qemu-5d50113cf675ec96337ac6eaf81d83fbf69273bc.tar.xz
qemu-5d50113cf675ec96337ac6eaf81d83fbf69273bc.zip
json: Assert json_parser_parse() consumes all tokens on success
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20180823164025.12553-47-armbru@redhat.com>
Diffstat (limited to 'qobject')
-rw-r--r--qobject/json-parser.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index e3ee2a273a..685e9dac24 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -544,6 +544,7 @@ QObject *json_parser_parse(GQueue *tokens, va_list *ap, Error **errp)
QObject *result;
result = parse_value(&ctxt, ap);
+ assert(ctxt.err || g_queue_is_empty(ctxt.buf));
error_propagate(errp, ctxt.err);