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.
This commit is contained in:
sth 2019-01-02 03:01:54 +01:00 committed by Benjamin Peterson
parent 7e3fb40b92
commit f8b534477a
2 changed files with 1 additions and 1 deletions

View File

@ -0,0 +1 @@
Fix a crash when sorting very long lists. Patch by Stephan Hohe.

View File

@ -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 &&