Skip to content

Commit

Permalink
Map.c check should be against PY_SSIZE_T_MAX (#2151)
Browse files Browse the repository at this point in the history
  • Loading branch information
wiredfool committed Oct 4, 2016
1 parent d6193e2 commit 7d6f410
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7d6f410

Please sign in to comment.