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:
parent
e1efc07a30
commit
1a1ff29659
15 changed files with 50 additions and 52 deletions
|
@ -254,7 +254,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
|
|||
|
||||
/* assume no change in size, first */
|
||||
n1 = n1 + 1;
|
||||
buf = PyMem_Malloc(n1 * sizeof(wchar_t));
|
||||
buf = PyMem_New(wchar_t, n1);
|
||||
if (!buf) {
|
||||
PyErr_NoMemory();
|
||||
goto exit;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue