From: Georg Brandl Date: Mon, 13 Mar 2006 22:22:11 +0000 (+0000) Subject: Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact X-Git-Tag: v2.5a0~255 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3daf75878df471bafb3c454c8f216fe7cbcb80ee;p=thirdparty%2FPython%2Fcpython.git Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact --- diff --git a/Objects/object.c b/Objects/object.c index 866ce068c209..c4634f7d074d 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -402,9 +402,9 @@ PyObject_Unicode(PyObject *v) PyObject *func; static PyObject *unicodestr; - if (v == NULL) + if (v == NULL) { res = PyString_FromString(""); - if (PyUnicode_CheckExact(v)) { + } else if (PyUnicode_CheckExact(v)) { Py_INCREF(v); return v; }