[libvirt PATCH 1/3] qemu: chardev: avoid impossible overflow

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

 



In the rare case where int and long long are not the same size,
the multiplication of an int variable and an int constant might
overflow. Cast the constant to long long to avoid this.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
Fixes: baa4edfb79d5ee861a08b5ec11416c5c156d8cd2
---
 src/qemu/qemu_chardev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_chardev.c b/src/qemu/qemu_chardev.c
index b6828b6752..6b29744975 100644
--- a/src/qemu/qemu_chardev.c
+++ b/src/qemu/qemu_chardev.c
@@ -247,7 +247,7 @@ qemuChardevGetBackendProps(const virDomainChrSourceDef *chr,
 
         if (reconnect != -1 &&
             virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_RECONNECT_MILISECONDS)) {
-            reconnect_ms = reconnect * 1000;
+            reconnect_ms = reconnect * (long long) 1000;
             reconnect = -1;
         }
 
-- 
2.47.0




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

  Powered by Linux