Skip to content

Commit

Permalink
Map.c check should be against PY_SSIZE_T_MAX (python-pillow#2151)
Browse files Browse the repository at this point in the history
  • Loading branch information
wiredfool authored and Fahad-Alsaidi committed Dec 13, 2016
1 parent 2932c2d commit d03c3d6
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 d03c3d6

Please sign in to comment.