Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0e64f5

Browse files
committed
make sure length is unsigned
1 parent e1bd38c commit c0e64f5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9489,7 +9489,7 @@ case_operation(PyObject *self,
94899489
PyErr_SetString(PyExc_OverflowError, "string is too long");
94909490
return NULL;
94919491
}
9492-
tmp = PyMem_MALLOC(sizeof(Py_UCS4) * 3 * length);
9492+
tmp = PyMem_MALLOC(sizeof(Py_UCS4) * 3 * (size_t)length);
94939493
if (tmp == NULL)
94949494
return PyErr_NoMemory();
94959495
newlength = perform(kind, data, length, tmp, &maxchar);

0 commit comments

Comments
 (0)