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

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


https://github.com/python/cpython/commit/da15389fddb85cf8a97b81e75de7d77b5f505b56
commit: da15389fddb85cf8a97b81e75de7d77b5f505b56
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-10-31T02:31:29-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 e4f778b1f8ea..037be870e36a 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -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;



More information about the Python-checkins mailing list