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/_localemodule.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/_localemodule.c')
-rw-r--r-- | Modules/_localemodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index 400c344..b1d6add 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -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; |