summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-03-13 22:22:11 (GMT)
committerGeorg Brandl <georg@python.org>2006-03-13 22:22:11 (GMT)
commit3daf75878df471bafb3c454c8f216fe7cbcb80ee (patch)
tree350b43892cfe81c2ef37b7b4e782546170b0227c /Objects
parentd364a07517bb2a413e5d4739c2f43c4af218be43 (diff)
downloadcpython-3daf75878df471bafb3c454c8f216fe7cbcb80ee.zip
cpython-3daf75878df471bafb3c454c8f216fe7cbcb80ee.tar.gz
cpython-3daf75878df471bafb3c454c8f216fe7cbcb80ee.tar.bz2
Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 866ce06..c4634f7 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("<NULL>");
- if (PyUnicode_CheckExact(v)) {
+ } else if (PyUnicode_CheckExact(v)) {
Py_INCREF(v);
return v;
}