qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 14/26] qapi: Make string input and opts visit


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 14/26] qapi: Make string input and opts visitor require non-null input
Date: Mon, 27 Feb 2017 10:58:45 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 02/26/2017 03:43 PM, Markus Armbruster wrote:
> 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: Markus Armbruster <address@hidden>
> ---
>  qapi/opts-visitor.c         |  1 +
>  qapi/string-input-visitor.c | 54 
> ++++++++++++++-------------------------------
>  2 files changed, 18 insertions(+), 37 deletions(-)
> 

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]