diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-16 11:28:22 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-16 11:28:22 (GMT) |
commit | 1a1ff29659f068659dea07f1bd67b8fd4331071c (patch) | |
tree | 20705986aa369225a02980a11f0a6a66a9eed0ee /Modules/zipimport.c | |
parent | e1efc07a30f4c17723c707ad761bfad538982b0c (diff) | |
download | cpython-1a1ff29659f068659dea07f1bd67b8fd4331071c.zip cpython-1a1ff29659f068659dea07f1bd67b8fd4331071c.tar.gz cpython-1a1ff29659f068659dea07f1bd67b8fd4331071c.tar.bz2 |
Issue #23446: Use PyMem_New instead of PyMem_Malloc to avoid possible integer
overflows. Added few missed PyErr_NoMemory().
Diffstat (limited to 'Modules/zipimport.c')
-rw-r--r-- | Modules/zipimport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c index 8fe9195..f2cc245 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -233,7 +233,7 @@ make_filename(PyObject *prefix, PyObject *name) Py_ssize_t len; len = PyUnicode_GET_LENGTH(prefix) + PyUnicode_GET_LENGTH(name) + 1; - p = buf = PyMem_Malloc(sizeof(Py_UCS4) * len); + p = buf = PyMem_New(Py_UCS4, len); if (buf == NULL) { PyErr_NoMemory(); return NULL; |