mirror of
https://github.com/python/cpython.git
synced 2026-04-23 20:31:12 +00:00
Fix a possible crash in range.__reversed__(). (GH-10252)
(cherry picked from commit c9a6168924)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
parent
b183750f99
commit
da15389fdd
1 changed files with 1 additions and 0 deletions
|
|
@ -1154,6 +1154,7 @@ range_reverse(PyObject *seq)
|
|||
it = PyObject_New(longrangeiterobject, &PyLongRangeIter_Type);
|
||||
if (it == NULL)
|
||||
return NULL;
|
||||
it->index = it->start = it->step = NULL;
|
||||
|
||||
/* start + (len - 1) * step */
|
||||
it->len = range->length;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue