mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #23985: Fixed integer overflow in iterator object. Patch by
Clement Rouault.
This commit is contained in:
commit
b2f3c2357c
3 changed files with 33 additions and 0 deletions
|
@ -54,6 +54,11 @@ iter_iternext(PyObject *iterator)
|
|||
seq = it->it_seq;
|
||||
if (seq == NULL)
|
||||
return NULL;
|
||||
if (it->it_index == PY_SSIZE_T_MAX) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"iter index too large");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
result = PySequence_GetItem(seq, it->it_index);
|
||||
if (result != NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue