From: Guido van Rossum Date: Tue, 4 Aug 1998 15:04:06 +0000 (+0000) Subject: Fix a potential problem in PyLong_FromString(): could fall through the X-Git-Tag: v1.5.2a1~165 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac6a37ae55b0f165dee662d65976c2d3ab9d2325;p=thirdparty%2FPython%2Fcpython.git Fix a potential problem in PyLong_FromString(): could fall through the for loop with z==NULL but continue to reference z later. --- diff --git a/Objects/longobject.c b/Objects/longobject.c index d638c64412a5..b15a3f0ff01f 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -499,6 +499,8 @@ PyLong_FromString(str, pend, base) Py_DECREF(z); z = temp; } + if (z == NULL) + return NULL; if (str == start) { PyErr_SetString(PyExc_ValueError, "no digits in long int constant");