Fix a possible crash in range.__reversed__(). (GH-10252)

This commit is contained in:
Zackery Spytz 2018-10-31 03:13:16 -06:00 committed by Serhiy Storchaka
parent 0353b4eaaf
commit c9a6168924
1 changed files with 1 additions and 0 deletions

View File

@ -1154,6 +1154,7 @@ long_range:
it = PyObject_New(longrangeiterobject, &PyLongRangeIter_Type); it = PyObject_New(longrangeiterobject, &PyLongRangeIter_Type);
if (it == NULL) if (it == NULL)
return NULL; return NULL;
it->index = it->start = it->step = NULL;
/* start + (len - 1) * step */ /* start + (len - 1) * step */
it->len = range->length; it->len = range->length;