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

Skip to content

Commit 9c422f3

Browse files
committed
merge 3.3
2 parents 60d7a73 + 1e211ff commit 9c422f3

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Objects/unicodeobject.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9651,12 +9651,11 @@ case_operation(PyObject *self,
96519651
kind = PyUnicode_KIND(self);
96529652
data = PyUnicode_DATA(self);
96539653
length = PyUnicode_GET_LENGTH(self);
9654-
if (length > PY_SSIZE_T_MAX / 3 ||
9655-
length > PY_SIZE_MAX / (3 * sizeof(Py_UCS4))) {
9654+
if (length > PY_SSIZE_T_MAX / (3 * sizeof(Py_UCS4))) {
96569655
PyErr_SetString(PyExc_OverflowError, "string is too long");
96579656
return NULL;
96589657
}
9659-
tmp = PyMem_MALLOC(sizeof(Py_UCS4) * 3 * (size_t)length);
9658+
tmp = PyMem_MALLOC(sizeof(Py_UCS4) * 3 * length);
96609659
if (tmp == NULL)
96619660
return PyErr_NoMemory();
96629661
newlength = perform(kind, data, length, tmp, &maxchar);

0 commit comments

Comments
 (0)