From 2f014f8d0bdd80fb0d650f5c20bd13bb3660f541 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Mon, 13 Mar 2006 22:22:15 +0000 Subject: Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact (backport from rev. 43014) --- Objects/object.c | 4 ++-- 1 file 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(""); - if (PyUnicode_CheckExact(v)) { + } else if (PyUnicode_CheckExact(v)) { Py_INCREF(v); return v; } -- cgit v0.12