mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-03 08:21:58 +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:
@ -1820,6 +1820,7 @@ libvirt_virConnectOpenAuth(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
|||||||
PyObject *pycredtype;
|
PyObject *pycredtype;
|
||||||
virConnectAuth auth;
|
virConnectAuth auth;
|
||||||
|
|
||||||
|
memset(&auth, 0, sizeof(auth));
|
||||||
if (!PyArg_ParseTuple(args, (char *)"zOi:virConnectOpenAuth", &name, &pyauth, &flags))
|
if (!PyArg_ParseTuple(args, (char *)"zOi:virConnectOpenAuth", &name, &pyauth, &flags))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user