Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 51454a6

Browse files
committed
merge 3.2 (#24044)
2 parents 418fd74 + 0823ffb commit 51454a6

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ What's New in Python 3.3.7?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #24044: Fix possible null pointer dereference in list.sort in out of
14+
memory conditions.
15+
1316
- Issue #23055: Fixed a buffer overflow in PyUnicode_FromFormatV. Analysis
1417
and fix by Guido Vranken.
1518

Objects/listobject.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,8 +1953,10 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
19531953
keys = &ms.temparray[saved_ob_size+1];
19541954
else {
19551955
keys = PyMem_MALLOC(sizeof(PyObject *) * saved_ob_size);
1956-
if (keys == NULL)
1957-
return NULL;
1956+
if (keys == NULL) {
1957+
PyErr_NoMemory();
1958+
goto keyfunc_fail;
1959+
}
19581960
}
19591961

19601962
for (i = 0; i < saved_ob_size ; i++) {

0 commit comments

Comments
 (0)