check should be against PY_SSIZE_T_MAX

This commit is contained in:
wiredfool 2016-10-04 06:10:28 -07:00
parent 9cf752a697
commit e4f6682d75

2
map.c
View File

@ -349,7 +349,7 @@ PyImaging_MapBuffer(PyObject* self, PyObject* args)
size = (Py_ssize_t) ysize * stride; size = (Py_ssize_t) ysize * stride;
if (offset > SIZE_MAX - size) { if (offset > PY_SSIZE_T_MAX - size) {
PyErr_SetString(PyExc_MemoryError, "Integer overflow in offset"); PyErr_SetString(PyExc_MemoryError, "Integer overflow in offset");
return NULL; return NULL;
} }