mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 09:26:16 +03:00
Map.c check should be against PY_SSIZE_T_MAX (#2151)
This commit is contained in:
parent
d6193e2cfa
commit
7d6f4104a1
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