mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39: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
|
@ -735,7 +735,7 @@ calculate_path(void)
|
|||
bufsz += wcslen(zip_path) + 1;
|
||||
bufsz += wcslen(exec_prefix) + 1;
|
||||
|
||||
buf = (wchar_t *)PyMem_Malloc(bufsz * sizeof(wchar_t));
|
||||
buf = PyMem_New(wchar_t, bufsz);
|
||||
if (buf == NULL) {
|
||||
Py_FatalError(
|
||||
"Not enough memory for dynamic PYTHONPATH");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue