From 3f73d9b680b8cef84ff8db0f762ea803e48a32a9 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Tue, 4 Oct 2016 14:40:22 +0100 Subject: [PATCH] Map.c check should be against PY_SSIZE_T_MAX (#2151) --- map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map.c b/map.c index 3637ee86a..75f463440 100644 --- a/map.c +++ b/map.c @@ -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; }