diff options
author | Georg Brandl <georg@python.org> | 2006-03-13 22:22:15 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-03-13 22:22:15 (GMT) |
commit | 2f014f8d0bdd80fb0d650f5c20bd13bb3660f541 (patch) | |
tree | f5158fdd076d42d10a9e2693b95c32908d68d615 | |
parent | 6b3cf5e00a3a6b41ffeaa4ad78ba0eaba8f05bf1 (diff) | |
download | cpython-2f014f8d0bdd80fb0d650f5c20bd13bb3660f541.zip cpython-2f014f8d0bdd80fb0d650f5c20bd13bb3660f541.tar.gz cpython-2f014f8d0bdd80fb0d650f5c20bd13bb3660f541.tar.bz2 |
Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact
(backport from rev. 43014)
-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 3f70009..87aa475 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("<NULL>"); - if (PyUnicode_CheckExact(v)) { + } else if (PyUnicode_CheckExact(v)) { Py_INCREF(v); return v; } |