imagick
imagick copied to clipboard
Follow up on potential stack corruption
On architectures where long is smaller than zend_long (e.g. LLP64), passing long* to zend_parse_parameters() as an l argument, causes stack corruption. I found these cases by running the test suite with a debug build on Windows. There might be more such issues, so a manual code review might be in order.
It also appears to be sensible to check the allowed ranges of the passed values before passing them to ImageMagick functions to avoid wrap-around or truncation.
from https://github.com/Imagick/imagick/pull/495