Commit d7552439 authored by Benjamin Peterson's avatar Benjamin Peterson

make sure length is unsigned

parent 34ef7c4e
...@@ -9489,7 +9489,7 @@ case_operation(PyObject *self, ...@@ -9489,7 +9489,7 @@ case_operation(PyObject *self,
PyErr_SetString(PyExc_OverflowError, "string is too long"); PyErr_SetString(PyExc_OverflowError, "string is too long");
return NULL; return NULL;
} }
tmp = PyMem_MALLOC(sizeof(Py_UCS4) * 3 * length); tmp = PyMem_MALLOC(sizeof(Py_UCS4) * 3 * (size_t)length);
if (tmp == NULL) if (tmp == NULL)
return PyErr_NoMemory(); return PyErr_NoMemory();
newlength = perform(kind, data, length, tmp, &maxchar); newlength = perform(kind, data, length, tmp, &maxchar);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment