summary refs log tree commit diff stats
path: root/include/qapi/qmp/json-lexer.h
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2018-08-23 18:40:11 +0200
committerMarkus Armbruster <armbru@redhat.com>2018-08-24 20:26:37 +0200
commite06d008ac833ac220b920f4d8858e6f62f7a59f9 (patch)
tree8b28f96005d8129d8b8ab14882f9d0a9dfcb1670 /include/qapi/qmp/json-lexer.h
parent2a4794ba146d6560bd77ca840ff6908f81d585f4 (diff)
downloadfocaccia-qemu-e06d008ac833ac220b920f4d8858e6f62f7a59f9.tar.gz
focaccia-qemu-e06d008ac833ac220b920f4d8858e6f62f7a59f9.zip
json: Fix latent parser aborts at end of input
json-parser.c carefully reports end of input like this:

    token = parser_context_pop_token(ctxt);
    if (token == NULL) {
        parse_error(ctxt, NULL, "premature EOI");
        goto out;
    }

Except parser_context_pop_token() can't return null, it fails its
assertion instead.  Same for parser_context_peek_token().  Broken in
commit 65c0f1e9558, and faithfully preserved in commit 95385fe9ace.
Only a latent bug, because the streamer throws away any input that
could trigger it.

Drop the assertions, so we can fix the streamer in the next commit.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180823164025.12553-45-armbru@redhat.com>
Diffstat (limited to 'include/qapi/qmp/json-lexer.h')
0 files changed, 0 insertions, 0 deletions