mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +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:
parent
e1efc07a30
commit
1a1ff29659
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