[Python-checkins] r43015 - python/branches/release24-maint/Objects/object.c

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


Author: georg.brandl
Date: Mon Mar 13 23:22:15 2006
New Revision: 43015

Modified:
   python/branches/release24-maint/Objects/object.c
Log:
Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact
 (backport from rev. 43014)

Modified: python/branches/release24-maint/Objects/object.c
==============================================================================
--- python/branches/release24-maint/Objects/object.c	(original)
+++ python/branches/release24-maint/Objects/object.c	Mon Mar 13 23:22:15 2006
@@ -374,9 +374,9 @@
 {
 	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;
 	}


More information about the Python-checkins mailing list