mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-03 07:33:50 +00:00
qemu: chardev: avoid impossible overflow
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@redhat.com> Fixes: baa4edfb79d5ee861a08b5ec11416c5c156d8cd2 Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
2e64ca6ef2
commit
13f40898ab
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user