This commit is contained in:
Benjamin Peterson 2015-04-23 17:06:45 -04:00
commit a30e2256f7
2 changed files with 7 additions and 2 deletions

View File

@ -78,6 +78,9 @@ Core and Builtins
- Issue #23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on
non-integer input.
- Issue #24044: Fix possible null pointer dereference in list.sort in out of
memory conditions.
Library
-------

View File

@ -1961,8 +1961,10 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
keys = &ms.temparray[saved_ob_size+1];
else {
keys = PyMem_MALLOC(sizeof(PyObject *) * saved_ob_size);
if (keys == NULL)
return NULL;
if (keys == NULL) {
PyErr_NoMemory();
goto keyfunc_fail;
}
}
for (i = 0; i < saved_ob_size ; i++) {