Commits

Georg Brandl  committed 8c1bf79

Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact
(backport from rev. 43014)

  • Participants
  • Parent commits a8fd91c
  • Branches 2.4

Comments (0)

Files changed (1)

File Objects/object.c

 {
 	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;
 	}