Skip to content

Fix signed integer overflow in Imagick::importImagePixels()#797

Open
ndossche wants to merge 1 commit into
Imagick:masterfrom
ndossche:ub-overflow
Open

Fix signed integer overflow in Imagick::importImagePixels()#797
ndossche wants to merge 1 commit into
Imagick:masterfrom
ndossche:ub-overflow

Conversation

@ndossche

Copy link
Copy Markdown
Contributor

width * height * map_len could cause signed integer overflow, which is UB. Avoid this by adding necessary checks. Since all variables are necessarily positive (or map_len 0), this can be done in unsigned math.

`width * height * map_len` could cause signed integer overflow, which is
UB. Avoid this by adding necessary checks. Since all variables are
necessarily positive (or map_len 0), this can be done in unsigned math.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant