mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Merge pull request #3609 from cgohlke/patch-2
Fix possible integer overflow
This commit is contained in:
commit
b20cbe5299
|
@ -1420,7 +1420,7 @@ _putdata(ImagingObject* self, PyObject* args)
|
|||
image = self->image;
|
||||
|
||||
n = PyObject_Length(data);
|
||||
if (n > (Py_ssize_t) (image->xsize * image->ysize)) {
|
||||
if (n > (Py_ssize_t)image->xsize * (Py_ssize_t)image->ysize) {
|
||||
PyErr_SetString(PyExc_TypeError, "too many data entries");
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user