mirror of https://gitee.com/openkylin/libvirt.git
Check against python None type when filling in auth parameters
When deciding whether to provide an auth function callback in openAuth(), credcb was checked against NULL, when it really needs to be checked against Py_None Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
01573bdf4f
commit
3f3d2f9dfc
|
@ -1840,7 +1840,8 @@ libvirt_virConnectOpenAuth(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
|||
auth.credtype[i] = (int)PyLong_AsLong(val);
|
||||
}
|
||||
}
|
||||
auth.cb = pycredcb ? virConnectCredCallbackWrapper : NULL;
|
||||
if (pycredcb && pycredcb != Py_None)
|
||||
auth.cb = virConnectCredCallbackWrapper;
|
||||
auth.cbdata = pyauth;
|
||||
|
||||
LIBVIRT_BEGIN_ALLOW_THREADS;
|
||||
|
|
Loading…
Reference in New Issue