]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Fix crash passing an empty list to python openAuth() API
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 10 Sep 2012 15:00:05 +0000 (16:00 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 11 Sep 2012 11:16:17 +0000 (12:16 +0100)
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>
python/libvirt-override.c

index 75bacff9768be7feec4fa394485519025f3b6147..c51dd3fac964e59cebff5d170e7a9bd849c9959d 100644 (file)
@@ -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;