Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an upper limit for blocks_max in _set_blocks_max #3703

Merged
merged 6 commits into from
Jun 27, 2019
Merged

Adding an upper limit for blocks_max in _set_blocks_max #3703

merged 6 commits into from
Jun 27, 2019

Conversation

jkrshnmenon
Copy link
Contributor

@jkrshnmenon jkrshnmenon commented Mar 8, 2019

Changes proposed in this pull request:

  • Fixing a potential integer overflow in ImagingMemorySetBlocksMax

The integer blocks_max is properly sanitized before being used in an arithmetic operation.
This PR should fix this issue by adding an upper limit to this variable.

If the error message is not appropriate, please do let me know and I will fix it accordingly.

@radarhere
Copy link
Member

You've created a separate test file for this, which means that it wouldn't be run in our standard tests. I would suggest adding your test commands below the test that blocks_max should be greater than 0.

@jkrshnmenon
Copy link
Contributor Author

jkrshnmenon commented Mar 18, 2019

Oh, my bad. I didn't know how to add the appropriate test-case.
I've added the test command like you suggested. But I'm not sure if this test-case needs to be run for 64-bit systems.
What would you suggest?

@radarhere
Copy link
Member

I've created https://github.com/jkrshnmenon/Pillow/pull/1 as a suggestion.

@hugovk hugovk merged commit 372c7c3 into python-pillow:master Jun 27, 2019
@hugovk
Copy link
Member

hugovk commented Jun 27, 2019

Thank you.

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.

3 participants