[libvirt] [PATCH 6/5 V5] GetCPUStats: fix overflow test

Eric Blake eblake at redhat.com
Thu Feb 9 23:58:14 UTC 2012


On 02/09/2012 03:43 AM, Lai Jiangshan wrote:
> Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
> ---
>  src/libvirt.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/libvirt.c b/src/libvirt.c
> index 8035add..a55d823 100644
> --- a/src/libvirt.c
> +++ b/src/libvirt.c
> @@ -18541,7 +18541,7 @@ int virDomainGetCPUStats(virDomainPtr domain,
>          (start_cpu == -1 && ncpus != 1) ||
>          ((params == NULL) != (nparams == 0)) ||
>          (ncpus == 0 && params != NULL) ||
> -        ncpus < UINT_MAX / nparams) {
> +        (nparams && ncpus > UINT_MAX / nparams)) {

Good catch, and I'm pushing this one now, before taking longer to review
the others.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120209/13996287/attachment-0001.sig>


More information about the libvir-list mailing list