mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-09 16:10:48 +03:00
Address more feedback; don't unlock around sizeof
This commit is contained in:
parent
06767fc325
commit
98b173928a
|
@ -4093,10 +4093,8 @@ _set_blocks_max(PyObject *self, PyObject *args) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
MUTEX_LOCK(&ImagingDefaultArena.mutex);
|
if ((unsigned long)blocks_max > SIZE_MAX /
|
||||||
size_t blocksize = sizeof(ImagingDefaultArena.blocks_pool[0]);
|
sizeof(ImagingDefaultArena.blocks_pool[0])) {
|
||||||
MUTEX_UNLOCK(&ImagingDefaultArena.mutex);
|
|
||||||
if ((unsigned long)blocks_max > SIZE_MAX / blocksize) {
|
|
||||||
PyErr_SetString(PyExc_ValueError, "blocks_max is too large");
|
PyErr_SetString(PyExc_ValueError, "blocks_max is too large");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user