diff options
author | Zackery Spytz <zspytz@gmail.com> | 2019-02-21 07:47:14 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2019-02-21 07:47:14 (GMT) |
commit | ebc793d6acb9650b9f497808e059805892031d74 (patch) | |
tree | 4dfe8f5ecea05d788c6f27dfed54975331abc40d /Objects | |
parent | ef1b88bf57aae93893d55f1b9c9639dbe9cc7786 (diff) | |
download | cpython-ebc793d6acb9650b9f497808e059805892031d74.zip cpython-ebc793d6acb9650b9f497808e059805892031d74.tar.gz cpython-ebc793d6acb9650b9f497808e059805892031d74.tar.bz2 |
bpo-33989: Ensure that ms.key_compare is always initialized in list_sort_impl(). (GH-8710)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/listobject.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index a08b3b5..cbd6e81 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -2334,6 +2334,9 @@ list_sort_impl(PyListObject *self, PyObject *keyfunc, int reverse) else if ((ms.key_richcompare = key_type->tp_richcompare) != NULL) { ms.key_compare = unsafe_object_compare; } + else { + ms.key_compare = safe_object_compare; + } } else { ms.key_compare = safe_object_compare; |