[Python-checkins] r43014 - python/trunk/Objects/object.c

georg.brandl python-checkins at python.org
Mon Mar 13 23:22:12 CET 2006


Author: georg.brandl
Date: Mon Mar 13 23:22:11 2006
New Revision: 43014

Modified:
   python/trunk/Objects/object.c
Log:
Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact


Modified: python/trunk/Objects/object.c
==============================================================================
--- python/trunk/Objects/object.c	(original)
+++ python/trunk/Objects/object.c	Mon Mar 13 23:22:11 2006
@@ -402,9 +402,9 @@
 	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;
 	}


More information about the Python-checkins mailing list