1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2024-10-27 00:55:11 +03:00

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>
This commit is contained in:
Daniel P. Berrange 2012-09-10 16:00:05 +01:00
parent 4b8444d892
commit d1b4ab2ae8

View 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;