summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-08-04 15:04:06 (GMT)
committerGuido van Rossum <guido@python.org>1998-08-04 15:04:06 (GMT)
commitac6a37ae55b0f165dee662d65976c2d3ab9d2325 (patch)
treecbb592d48b3cdfa1015f47debb2be5edce3d5d01 /Objects/longobject.c
parentdf3d8756b77979279784d2a5545574e2eda85eea (diff)
downloadcpython-ac6a37ae55b0f165dee662d65976c2d3ab9d2325.zip
cpython-ac6a37ae55b0f165dee662d65976c2d3ab9d2325.tar.gz
cpython-ac6a37ae55b0f165dee662d65976c2d3ab9d2325.tar.bz2
Fix a potential problem in PyLong_FromString(): could fall through the
for loop with z==NULL but continue to reference z later.
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r--Objects/longobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index d638c64..b15a3f0 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");