From: Daniel P. Berrange Date: Mon, 10 Sep 2012 15:45:53 +0000 (+0100) Subject: Check against python None type when filling in auth parameters X-Git-Tag: CVE-2012-4423~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f3d2f9dfc0f319cc47e13cec6128be2e39400c4;p=thirdparty%2Flibvirt.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 --- diff --git a/python/libvirt-override.c b/python/libvirt-override.c index 768144a009..bb1d881f1e 100644 --- a/python/libvirt-override.c +++ b/python/libvirt-override.c @@ -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;