Map.c check should be against PY_SSIZE_T_MAX (#2151)

This commit is contained in:
wiredfool 2016-10-04 14:40:22 +01:00
parent 6eb8d2c4c2
commit 3d2e407de7

2
map.c
View File

@ -349,7 +349,7 @@ PyImaging_MapBuffer(PyObject* self, PyObject* args)
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");
return NULL;
}