[PATCH] Fix crash in virDomainGetVcpuPinInfo python wrapper

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

It is possible to jump to the cleanup block before the cpumaps
variable gets initialized. This will result in a VIR_FREE of
an uninitializer pointer

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 python/libvirt-override.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index d16b9a2..cc76c47 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -1769,7 +1769,7 @@ libvirt_virDomainGetVcpuPinInfo(PyObject *self ATTRIBUTE_UNUSED,
     virDomainPtr domain;
     PyObject *pyobj_domain, *pycpumaps = NULL;
     virDomainInfo dominfo;
-    unsigned char *cpumaps;
+    unsigned char *cpumaps = NULL;
     size_t cpumaplen, vcpu, pcpu;
     unsigned int flags;
     int i_retval, cpunum;
-- 
1.8.3.1

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