From: Georg Brandl Date: Mon, 13 Mar 2006 22:22:15 +0000 (+0000) Subject: Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact X-Git-Tag: v2.4.3c1~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f014f8d0bdd80fb0d650f5c20bd13bb3660f541;p=thirdparty%2FPython%2Fcpython.git Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact (backport from rev. 43014) --- diff --git a/Objects/object.c b/Objects/object.c index 3f70009bd3ff..87aa475a6092 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -374,9 +374,9 @@ PyObject_Unicode(PyObject *v) { PyObject *res; - if (v == NULL) + if (v == NULL) { res = PyString_FromString(""); - if (PyUnicode_CheckExact(v)) { + } else if (PyUnicode_CheckExact(v)) { Py_INCREF(v); return v; }