Fix a potential problem in PyLong_FromString(): could fall through the

for loop with z==NULL but continue to reference z later.
This commit is contained in:
Guido van Rossum 1998-08-04 15:04:06 +00:00
parent df3d8756b7
commit ac6a37ae55
1 changed files with 2 additions and 0 deletions

View 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");