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>
This commit is contained in:
parent
f9277915ee
commit
5d50113cf6
@ -544,6 +544,7 @@ QObject *json_parser_parse(GQueue *tokens, va_list *ap, Error **errp)
|
|||||||
QObject *result;
|
QObject *result;
|
||||||
|
|
||||||
result = parse_value(&ctxt, ap);
|
result = parse_value(&ctxt, ap);
|
||||||
|
assert(ctxt.err || g_queue_is_empty(ctxt.buf));
|
||||||
|
|
||||||
error_propagate(errp, ctxt.err);
|
error_propagate(errp, ctxt.err);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user