mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
Fix a possible crash in range.__reversed__(). (GH-10252)
This commit is contained in:
parent
0353b4eaaf
commit
c9a6168924
1 changed files with 1 additions and 0 deletions
|
|
@ -1154,6 +1154,7 @@ range_reverse(PyObject *seq, PyObject *Py_UNUSED(ignored))
|
|||
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