mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #23446: Use PyMem_New instead of PyMem_Malloc to avoid possible integer
overflows. Added few missed PyErr_NoMemory().
This commit is contained in:
commit
4d0d982985
15 changed files with 50 additions and 52 deletions
|
@ -850,7 +850,7 @@ seq_as_ssize_array(PyObject *seq, Py_ssize_t len, int is_shape)
|
|||
Py_ssize_t *dest;
|
||||
Py_ssize_t x, i;
|
||||
|
||||
dest = PyMem_Malloc(len * (sizeof *dest));
|
||||
dest = PyMem_New(Py_ssize_t, len);
|
||||
if (dest == NULL) {
|
||||
PyErr_NoMemory();
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue