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

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



From: "Daniel P. Berrange" <berrange 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 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


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