]> granicus.if.org Git - python/commitdiff
Add missing "return NULL" in overflow check in PyObject_Repr().
authorGuido van Rossum <guido@python.org>
Tue, 6 Nov 2007 23:32:56 +0000 (23:32 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 6 Nov 2007 23:32:56 +0000 (23:32 +0000)
Objects/stringobject.c

index 3c140229812d68ca5ad241e04f38bdef8a720588..ce24154becc8ba7d9ee654594d3a0f77db373684 100644 (file)
@@ -869,6 +869,7 @@ PyString_Repr(PyObject *obj, int smartquotes)
        if (newsize > PY_SSIZE_T_MAX || newsize / 4 != Py_Size(op)) {
                PyErr_SetString(PyExc_OverflowError,
                        "string is too large to make repr");
+                return NULL;
        }
        v = PyString_FromStringAndSize((char *)NULL, newsize);
        if (v == NULL) {