Commit f8b53447 authored by sth's avatar sth Committed by Benjamin Peterson

closes bpo-35623: Fix integer overflow when sorting large lists (GH-11380)

There is already a `Py_ssize_t i` defined at function scope that is used
for similar loops. By removing the local `int i` declaration that `i` is
used, which has the appropriate type.
parent 7e3fb40b
Fix a crash when sorting very long lists. Patch by Stephan Hohe.
......@@ -2283,7 +2283,6 @@ list_sort_impl(PyListObject *self, PyObject *keyfunc, int reverse)
int ints_are_bounded = 1;
/* Prove that assumption by checking every key. */
int i;
for (i=0; i < saved_ob_size; i++) {
if (keys_are_in_tuples &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment