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 d6193e2cfa
commit 7d6f4104a1

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;
}