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:
parent
7e3fb40b92
commit
f8b534477a
|
@ -0,0 +1 @@
|
|||
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 &&
|
||||
|
|
Loading…
Reference in New Issue