From: Lai Jiangshan Date: Thu, 9 Feb 2012 10:43:10 +0000 (+0800) Subject: GetCPUStats: fix overflow test X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f9f2d3b100b81ad6c556df7dcdf3abcf6166b009;p=libvirt.git GetCPUStats: fix overflow test Bug introduced in commit c6ec021b. Signed-off-by: Lai Jiangshan --- diff --git a/src/libvirt.c b/src/libvirt.c index 8035add37e..a55d823955 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)) { virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__); goto error; }