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

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

 



Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
---
 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)) {
         virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
-- 
1.7.4.4

--
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]