mirror of https://gitee.com/openkylin/libvirt.git
GetCPUStats: fix overflow test
Bug introduced in commit c6ec021b
.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
This commit is contained in:
parent
42043afcdc
commit
f9f2d3b100
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue