From 86afcfd8f96c6b5bfcdc479143a4db0fd951e448 Mon Sep 17 00:00:00 2001 From: cgohlke Date: Fri, 25 Jan 2019 15:11:22 -0800 Subject: [PATCH] Fix possible integer overflow --- src/_imaging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_imaging.c b/src/_imaging.c index ed4702d55..7715a7995 100644 --- a/src/_imaging.c +++ b/src/_imaging.c @@ -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; }