From 3daf75878df471bafb3c454c8f216fe7cbcb80ee Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Mon, 13 Mar 2006 22:22:11 +0000 Subject: [PATCH] Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact --- Objects/object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Objects/object.c b/Objects/object.c index 866ce068c20..c4634f7d074 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; }