Skip to content

bpo-37188: Fix a divide-by-zero in arrays of size-0 objects #13881

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

Merged
merged 1 commit into from
Jun 7, 2019

Conversation

eric-wieser
Copy link
Contributor

@eric-wieser eric-wieser commented Jun 7, 2019

itemsize can be zero when _type_ is an empty struct or length-0 array.

This line used to be length * itemsize < 0, which didn't exhibit this problem.

https://bugs.python.org/issue37188

`itemsize` can be zero when `_type_` is an empty struct or length-0 array.

This line used to be `length * itemsize < 0`, which didn't exhibit this problem.
@eric-wieser
Copy link
Contributor Author

@skrah, mind taking a look since this blocks #5576?

@skrah skrah added the skip news label Jun 7, 2019
@skrah skrah merged commit 0690c79 into python:master Jun 7, 2019
@bedevere-bot
Copy link

@skrah: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

Thanks @eric-wieser for the PR, and @skrah for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @eric-wieser for the PR, and @skrah for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @eric-wieser and @skrah, I had trouble checking out the 2.7 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 0690c79c419b8d2bdfe7c5b6dca57b018f5a5a54 2.7

@bedevere-bot
Copy link

GH-13882 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 7, 2019
@skrah
Copy link
Contributor

skrah commented Jun 7, 2019

@eric-wieser Thanks for catching this! This appears to have been backported to 2.7 and the auto-backport fails. Do you have time to do a manual backport PR?

@skrah
Copy link
Contributor

skrah commented Jun 7, 2019

Actually I missed assert sizeof(obj) == 0, which should use self.assertEqual(). I can change that in a follow-up.

@miss-islington
Copy link
Contributor

Thanks @eric-wieser for the PR, and @skrah for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @eric-wieser and @skrah, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 0690c79c419b8d2bdfe7c5b6dca57b018f5a5a54 2.7

@bedevere-bot
Copy link

GH-13906 is a backport of this pull request to the 2.7 branch.

@miss-islington
Copy link
Contributor

Thanks @eric-wieser for the PR, and @skrah for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-13911 is a backport of this pull request to the 3.8 branch.

DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants