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

Miss Islington (bot) webhook-mailer at python.org
Wed Oct 31 05:33:08 EDT 2018


https://github.com/python/cpython/commit/00093f61b38c01045b71a27eef0ff64a69188e8f
commit: 00093f61b38c01045b71a27eef0ff64a69188e8f
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-10-31T02:33:00-07:00
summary:

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

(cherry picked from commit c9a6168924ffa4f3f78175998b392fe23d3edc50)

Co-authored-by: Zackery Spytz <zspytz at gmail.com>

files:
M Objects/rangeobject.c

diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index 2fc70cd8d7b7..4f392a4c901a 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -1256,6 +1256,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;



More information about the Python-checkins mailing list