Skip to content
  • Markus Armbruster's avatar
    e06d008a
    json: Fix latent parser aborts at end of input · e06d008a
    Markus Armbruster authored
    
    
    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 65c0f1e9, and faithfully preserved in commit 95385fe9.
    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: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20180823164025.12553-45-armbru@redhat.com>
    e06d008a
    json: Fix latent parser aborts at end of input
    Markus Armbruster authored
    
    
    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 65c0f1e9, and faithfully preserved in commit 95385fe9.
    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: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20180823164025.12553-45-armbru@redhat.com>
Loading