diff options
author | Georg Brandl <georg@python.org> | 2006-03-13 22:22:11 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-03-13 22:22:11 (GMT) |
commit | 3daf75878df471bafb3c454c8f216fe7cbcb80ee (patch) | |
tree | 350b43892cfe81c2ef37b7b4e782546170b0227c /Objects/object.c | |
parent | d364a07517bb2a413e5d4739c2f43c4af218be43 (diff) | |
download | cpython-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/object.c')
-rw-r--r-- | Objects/object.c | 4 |
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; } |