From 9b847b432cda06cb1c1fd58a46efb7f0eca1cad1 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 6 Nov 2007 23:32:56 +0000 Subject: [PATCH] Add missing "return NULL" in overflow check in PyObject_Repr(). --- Objects/stringobject.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 3c140229812..ce24154becc 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -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) {