]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix a possible crash in range.__reversed__(). (GH-10252)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 31 Oct 2018 09:31:29 +0000 (02:31 -0700)
committerGitHub <noreply@github.com>
Wed, 31 Oct 2018 09:31:29 +0000 (02:31 -0700)
(cherry picked from commit c9a6168924ffa4f3f78175998b392fe23d3edc50)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Objects/rangeobject.c

index e4f778b1f8eaa6a5a8a4344fee47b82ae8b6d07a..037be870e36ab1fbba00cd6212c8dffafaa64d2b 100644 (file)
@@ -1154,6 +1154,7 @@ long_range:
     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;