[libvirt] [PATCH] Fix crash in virDomainGetVcpuPinInfo python wrapper

Daniel P. Berrange berrange at redhat.com
Tue Sep 3 15:37:44 UTC 2013


From: "Daniel P. Berrange" <berrange at redhat.com>

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 at redhat.com>
---
 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




More information about the libvir-list mailing list