[Python-checkins] Fix a possible crash in range.__reversed__(). (GH-10252)

Serhiy Storchaka webhook-mailer at python.org
Wed Oct 31 05:13:28 EDT 2018


https://github.com/python/cpython/commit/c9a6168924ffa4f3f78175998b392fe23d3edc50
commit: c9a6168924ffa4f3f78175998b392fe23d3edc50
branch: master
author: Zackery Spytz <zspytz at gmail.com>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2018-10-31T11:13:16+02:00
summary:

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

files:
M Objects/rangeobject.c

diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index 2b00a17425a2..e7b47bde6661 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -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;



More information about the Python-checkins mailing list