Backport r58892.

Add missing "return NULL" in overflow check in PyString_Repr().
This commit is contained in:
Guido van Rossum 2007-11-07 01:19:49 +00:00
parent a1e5387ec5
commit e6a6f39cc7

View file

@ -861,6 +861,7 @@ PyString_Repr(PyObject *obj, int smartquotes)
if (newsize > PY_SSIZE_T_MAX || newsize / 4 != op->ob_size) {
PyErr_SetString(PyExc_OverflowError,
"string is too large to make repr");
return NULL;
}
v = PyString_FromStringAndSize((char *)NULL, newsize);
if (v == NULL) {