]> 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:33:00 +0000 (02:33 -0700)
committerGitHub <noreply@github.com>
Wed, 31 Oct 2018 09:33:00 +0000 (02:33 -0700)
(cherry picked from commit c9a6168924ffa4f3f78175998b392fe23d3edc50)

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

index 2fc70cd8d7b7c5bf791d2c88dd914315d88fe5e4..4f392a4c901adc251c15fc3aa0946296d635f335 100644 (file)
@@ -1256,6 +1256,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;