summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-09-10 16:00:05 +0100
committerDaniel P. Berrange <berrange@redhat.com>2012-09-11 12:16:17 +0100
commitd1b4ab2ae843c3989885e043cf065a9288271cf2 (patch)
tree52bcc6105b0f53c8a18a41b20b47dfbd64e3b7b3
parent4b8444d8921c9276e0ae638cad2a07ea2df5879e (diff)
downloadlibvirt-python-split-d1b4ab2ae843c3989885e043cf065a9288271cf2.zip
libvirt-python-split-d1b4ab2ae843c3989885e043cf065a9288271cf2.tar.gz
libvirt-python-split-d1b4ab2ae843c3989885e043cf065a9288271cf2.tar.xz
Fix crash passing an empty list to python openAuth() API
If passing a 'credtype' parameter which was an empty list to the python openAuth() API, the 'credtype' field in the virConnectAuth struct would not be initialized. This lead to a crash when later trying to free that field. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
-rw-r--r--libvirt-override.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libvirt-override.c b/libvirt-override.c
index 75bacff..c51dd3f 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -1820,6 +1820,7 @@ libvirt_virConnectOpenAuth(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *pycredtype;
virConnectAuth auth;
+ memset(&auth, 0, sizeof(auth));
if (!PyArg_ParseTuple(args, (char *)"zOi:virConnectOpenAuth", &name, &pyauth, &flags))
return NULL;