diff -r db600c927b2b Objects/unicodeobject.c --- a/Objects/unicodeobject.c Sun Aug 24 12:23:36 2014 +0300 +++ b/Objects/unicodeobject.c Sun Aug 24 13:17:11 2014 +0300 @@ -816,7 +816,7 @@ assert(_PyUnicode_WSTR(unicode) != NULL); /* check for integer overflow */ - if (length > PY_SSIZE_T_MAX / sizeof(wchar_t) - 1) { + if (length > PY_SSIZE_T_MAX / (int)sizeof(wchar_t) - 1) { PyErr_NoMemory(); return -1; } @@ -888,7 +888,7 @@ } /* Ensure we won't overflow the size. */ - if (length > ((PY_SSIZE_T_MAX / sizeof(Py_UNICODE)) - 1)) { + if (length > ((PY_SSIZE_T_MAX / (int)sizeof(Py_UNICODE)) - 1)) { return (PyUnicodeObject *)PyErr_NoMemory(); } if (length < 0) { @@ -2239,7 +2239,7 @@ if (copy_null) targetlen++; if (!target) { - if (PY_SSIZE_T_MAX / sizeof(Py_UCS4) < targetlen) { + if (PY_SSIZE_T_MAX / (int)sizeof(Py_UCS4) < targetlen) { PyErr_NoMemory(); return NULL; } @@ -2852,7 +2852,7 @@ buflen = unicode_aswidechar(unicode, NULL, 0); if (buflen == -1) return NULL; - if (PY_SSIZE_T_MAX / sizeof(wchar_t) < buflen) { + if (PY_SSIZE_T_MAX / (int)sizeof(wchar_t) < buflen) { PyErr_NoMemory(); return NULL; } @@ -15394,7 +15394,7 @@ if (u == NULL) return NULL; /* Ensure we won't overflow the size. */ - if (len > ((PY_SSIZE_T_MAX / sizeof(Py_UNICODE)) - 1)) { + if (len > ((PY_SSIZE_T_MAX / (int)sizeof(Py_UNICODE)) - 1)) { PyErr_NoMemory(); return NULL; }