GetCPUStats: fix overflow test

Bug introduced in commit c6ec021b.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
This commit is contained in:
Lai Jiangshan 2012-02-09 18:43:10 +08:00 committed by Eric Blake
parent 42043afcdc
commit f9f2d3b100
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}