summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-10-15 15:51:05 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-10-15 15:51:05 (GMT)
commitc0e64f5027a2d07976027447b6d1ef464a2dc158 (patch)
tree7293eb88fad65daee227581abf9f6c57b552a848
parente1bd38c03c16cd27227b3148d2be0ef1ab678448 (diff)
downloadcpython-c0e64f5027a2d07976027447b6d1ef464a2dc158.zip
cpython-c0e64f5027a2d07976027447b6d1ef464a2dc158.tar.gz
cpython-c0e64f5027a2d07976027447b6d1ef464a2dc158.tar.bz2
make sure length is unsigned
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 35da457..2a10eec 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);