From: Benjamin Peterson Date: Wed, 15 Oct 2014 15:51:05 +0000 (-0400) Subject: make sure length is unsigned X-Git-Tag: v3.4.3rc1~466^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c0e64f5027a2d07976027447b6d1ef464a2dc158;p=thirdparty%2FPython%2Fcpython.git make sure length is unsigned --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 35da4575308d..2a10eec5ebc1 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -9489,7 +9489,7 @@ case_operation(PyObject *self, PyErr_SetString(PyExc_OverflowError, "string is too long"); return NULL; } - tmp = PyMem_MALLOC(sizeof(Py_UCS4) * 3 * length); + tmp = PyMem_MALLOC(sizeof(Py_UCS4) * 3 * (size_t)length); if (tmp == NULL) return PyErr_NoMemory(); newlength = perform(kind, data, length, tmp, &maxchar);