fix integer overflow in _imaging.c#1711
Conversation
|
Thanks for reporting this. I think we're going to include this in 3.1.1 today. |
|
I'm trying to add the test from the issue in a way that fails pre-patch, but I'm getting a failed malloc: I've tried this on a small and large memory machine where it should have enough memory to allocate several Gb, but each time it winds up giving me a MemoryError. Unfortunately, this is indistinguishable from the post-patch case. edit -- the test I'm using: |
|
closed in favor of #1714 |
|
@wiredfool it looks like you've already merged in the fix, but just to follow up: Because |
|
Makes sense, I'll check it out on a 32 bit vm |
Fixes issue #1710. I added the canonical integer overflow check used across the CPython codebase.
Perhaps it's better to raise an
OverflowErrorbut I'm trying to keep some consistency with the surrounding code.