Skip to content
  • Markus Armbruster's avatar
    f332e830
    qapi: Make string input and opts visitor require non-null input · f332e830
    Markus Armbruster authored
    
    
    The string input visitor tries to cope with null input.  Null input
    isn't used anywhere, and isn't covered by tests.  Unsurprisingly, it
    doesn't fully work: start_list() crashes because it passes the input
    via parse_str() to strtoll() unchecked.
    
    Make string_input_visitor_new() assert its argument isn't null, and
    drop the code trying to deal with null input.
    
    The opts visitor crashes when you try to actually visit something with
    null input.  Make opts_visitor_new() assert its argument isn't null,
    mostly for clarity.
    
    qobject_input_visitor_new() already asserts its argument isn't null.
    
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <1488544368-30622-17-git-send-email-armbru@redhat.com>
    f332e830
    qapi: Make string input and opts visitor require non-null input
    Markus Armbruster authored
    
    
    The string input visitor tries to cope with null input.  Null input
    isn't used anywhere, and isn't covered by tests.  Unsurprisingly, it
    doesn't fully work: start_list() crashes because it passes the input
    via parse_str() to strtoll() unchecked.
    
    Make string_input_visitor_new() assert its argument isn't null, and
    drop the code trying to deal with null input.
    
    The opts visitor crashes when you try to actually visit something with
    null input.  Make opts_visitor_new() assert its argument isn't null,
    mostly for clarity.
    
    qobject_input_visitor_new() already asserts its argument isn't null.
    
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <1488544368-30622-17-git-send-email-armbru@redhat.com>
Loading