Skip to content

Commit

Permalink
Fix a possible crash in range.__reversed__(). (GH-10252)
Browse files Browse the repository at this point in the history
(cherry picked from commit c9a6168)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
  • Loading branch information
miss-islington and ZackerySpytz committed Oct 31, 2018
1 parent b183750 commit da15389
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Objects/rangeobject.c
Expand Up @@ -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;
Expand Down

0 comments on commit da15389

Please sign in to comment.