qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 4/7] smbios: Make multiple -smbios type= accu


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 4/7] smbios: Make multiple -smbios type= accumulate sanely
Date: Sat, 17 Aug 2013 06:48:25 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

On 08/16/2013 07:18 AM, address@hidden wrote:
> From: Markus Armbruster <address@hidden>
> 
> Currently, -smbios type=T,NAME=VAL,... adds one field (T,NAME) with
> value VAL to fw_cfg for each unique NAME.  If NAME occurs multiple
> times, the last one's VAL is used (before the QemuOpts conversion, the
> first one was used).
> 

> +
> +            val = qemu_opt_get(opts, "release");
> +            if (val) {
> +                if (sscanf(val, "%hhu.%hhu", &type0.major, &type0.minor) != 
> 2) {
> +                    error_report("Invalid release");

As in v1, I'm not a fan of using sscanf for integer parsing (it has
undefined behavior if the user provides a value that overflows the
destination type); but as this is code motion, it does not invalidate my
review.

-- 
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]