]> granicus.if.org Git - python/commitdiff
Fix a potential problem in PyLong_FromString(): could fall through the
authorGuido van Rossum <guido@python.org>
Tue, 4 Aug 1998 15:04:06 +0000 (15:04 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 4 Aug 1998 15:04:06 +0000 (15:04 +0000)
for loop with z==NULL but continue to reference z later.

Objects/longobject.c

index d638c64412a51b69476614160d6e9f7cdddc090e..b15a3f0ff01fea284a4e42c205e466bc7188df2a 100644 (file)
@@ -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");