Re: [PATCH 06/10] vl.c: handle invalid NUMA CPU ranges properly

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

 



On 01/11/2013 11:15 AM, Eduardo Habkost wrote:
> Add checks for the following cases:
> 
> * Empty string: will be ignored and won't set any CPU bitmap,
>   parser won't abort.
> * Missing end value after "-": parser will abort.
> * Extra characters after a valid CPU range: parser will abort.
> * "N-M" string where M < N: parser will abort.


>      value = strtoull(cpus, &endptr, 10);
>      if (*endptr == '-') {
> -        endvalue = strtoull(endptr+1, &endptr, 10);
> +        endptr++;
> +        if (!*endptr) {
> +            goto error;
> +        }
> +        endvalue = strtoull(endptr, &endptr, 10);
>      } else {
>          endvalue = value;
>      }

Still missing a check for '-numa=-2' with no number on the left of '-',
as well as missing a check for overflow for -numa=999999999999999999999999

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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]