From a2025cd7112a16eef0c075dff5ee2ead323a302b Mon Sep 17 00:00:00 2001 From: Stephan Hohe Date: Mon, 31 Dec 2018 01:45:06 +0100 Subject: [PATCH 1/3] Fix integer overflow when sorting large lists 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. --- Objects/listobject.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Objects/listobject.c b/Objects/listobject.c index 17c37ba9756073..e11a3fdd1358de 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -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 && From 7ca9e286bf4dd9a5e7a9d1a0240ca03770ec0c75 Mon Sep 17 00:00:00 2001 From: Stephan Hohe Date: Mon, 31 Dec 2018 02:37:27 +0100 Subject: [PATCH 2/3] Added news --- .../Core and Builtins/2018-12-31-02-37-20.bpo-35623.24AQhY.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2018-12-31-02-37-20.bpo-35623.24AQhY.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-12-31-02-37-20.bpo-35623.24AQhY.rst b/Misc/NEWS.d/next/Core and Builtins/2018-12-31-02-37-20.bpo-35623.24AQhY.rst new file mode 100644 index 00000000000000..cb4c833b51fced --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-12-31-02-37-20.bpo-35623.24AQhY.rst @@ -0,0 +1 @@ +Fix a crash when sorting very long lists From 500a97b7e9d5d47f67dfb950fb1ad5fa49a0a6cd Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 31 Dec 2018 17:00:08 +0100 Subject: [PATCH 3/3] Add author to news Co-Authored-By: sth --- .../Core and Builtins/2018-12-31-02-37-20.bpo-35623.24AQhY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-12-31-02-37-20.bpo-35623.24AQhY.rst b/Misc/NEWS.d/next/Core and Builtins/2018-12-31-02-37-20.bpo-35623.24AQhY.rst index cb4c833b51fced..6e3df4dc5d4e16 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2018-12-31-02-37-20.bpo-35623.24AQhY.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2018-12-31-02-37-20.bpo-35623.24AQhY.rst @@ -1 +1 @@ -Fix a crash when sorting very long lists +Fix a crash when sorting very long lists. Patch by Stephan Hohe.