summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-03-02 18:23:25 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-03-02 18:23:25 (GMT)
commite5a853c390f76f8d73939138adf70604fe33ca4c (patch)
treeece88ae32480de88961edc2e288b62866b165b8e /Objects
parentb779bfba458a8147cce44100cbc14ec304807197 (diff)
downloadcpython-e5a853c390f76f8d73939138adf70604fe33ca4c.zip
cpython-e5a853c390f76f8d73939138adf70604fe33ca4c.tar.gz
cpython-e5a853c390f76f8d73939138adf70604fe33ca4c.tar.bz2
use PyMem_NEW to detect overflow (closes #23362)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 156316b..2bc34c5 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -8501,7 +8501,7 @@ _PyUnicode_TranslateCharmap(PyObject *input,
/* allocate enough for a simple 1:1 translation without
replacements, if we need more, we'll resize */
osize = size;
- output = PyMem_Malloc(osize * sizeof(Py_UCS4));
+ output = PyMem_NEW(Py_UCS4, osize);
opos = 0;
if (output == NULL) {
PyErr_NoMemory();