mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-17 18:54:46 +03:00
check should be against PY_SSIZE_T_MAX
This commit is contained in:
parent
9cf752a697
commit
e4f6682d75
2
map.c
2
map.c
|
@ -349,7 +349,7 @@ PyImaging_MapBuffer(PyObject* self, PyObject* args)
|
||||||
|
|
||||||
size = (Py_ssize_t) ysize * stride;
|
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");
|
PyErr_SetString(PyExc_MemoryError, "Integer overflow in offset");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user