]> granicus.if.org Git - python/commitdiff
Backport r58892.
authorGuido van Rossum <guido@python.org>
Wed, 7 Nov 2007 01:19:49 +0000 (01:19 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 7 Nov 2007 01:19:49 +0000 (01:19 +0000)
Add missing "return NULL" in overflow check in PyString_Repr().

Objects/stringobject.c

index 0e3dc4f780e46d716424afbf1cc0dd75060e269c..6673f670a0ab549cc2da69dcc9f700dd73180fa3 100644 (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) {