mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Mark Favas was quick to note that the last checkin divides by zero
when n == 0... So divide by a->ob_size instead which was already tested for 0.
This commit is contained in:
parent
5bc51f2f27
commit
0eb55ac912
1 changed files with 1 additions and 1 deletions
|
|
@ -374,7 +374,7 @@ tuplerepeat(a, n)
|
||||||
return (PyObject *)a;
|
return (PyObject *)a;
|
||||||
}
|
}
|
||||||
size = a->ob_size * n;
|
size = a->ob_size * n;
|
||||||
if (size/n != a->ob_size)
|
if (size/a->ob_size != n)
|
||||||
return PyErr_NoMemory();
|
return PyErr_NoMemory();
|
||||||
np = (PyTupleObject *) PyTuple_New(size);
|
np = (PyTupleObject *) PyTuple_New(size);
|
||||||
if (np == NULL)
|
if (np == NULL)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue