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

bpo-36504: Fix signed integer overflow in _ctypes.c's PyCArrayType_new() #12660

Conversation

ZackerySpytz
Copy link
Contributor

@ZackerySpytz ZackerySpytz commented Apr 2, 2019

@miss-islington
Copy link
Contributor

miss-islington commented Apr 2, 2019

Thanks @ZackerySpytz for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.7.
🐍🍒🤖

@ZackerySpytz
Copy link
Contributor Author

ZackerySpytz commented Apr 3, 2019

Hi, @serhiy-storchaka. It seems that the bot failed to create the backports?

@miss-islington
Copy link
Contributor

miss-islington commented Apr 3, 2019

Thanks @ZackerySpytz for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7.
🐍🍒🤖

@miss-islington
Copy link
Contributor

miss-islington commented Apr 3, 2019

Thanks @ZackerySpytz for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒🤖 I'm not a witch! I'm not a witch!

@miss-islington
Copy link
Contributor

miss-islington commented Apr 3, 2019

Sorry, @ZackerySpytz and @serhiy-storchaka, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 487b73ab39c80157474821ef9083f51e0846bd62 2.7

@bedevere-bot
Copy link

bedevere-bot commented Apr 3, 2019

GH-12676 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 Apr 3, 2019
…w(). (pythonGH-12660)

(cherry picked from commit 487b73a)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Apr 3, 2019

Do you mind to create a backport to 2.7 manually if the bug exists in 2.7?

miss-islington added a commit that referenced this pull request Apr 3, 2019
…w(). (GH-12660)

(cherry picked from commit 487b73a)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
ZackerySpytz added a commit to ZackerySpytz/cpython that referenced this pull request Apr 3, 2019
@bedevere-bot
Copy link

bedevere-bot commented Apr 3, 2019

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

@ZackerySpytz
Copy link
Contributor Author

ZackerySpytz commented Apr 3, 2019

I created the backport to 2.7.

serhiy-storchaka pushed a commit that referenced this pull request Apr 3, 2019
@@ -1518,7 +1518,7 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}

itemsize = itemdict->size;
if (length * itemsize < 0) {
if (length > PY_SSIZE_T_MAX / itemsize) {
Copy link
Contributor

@eric-wieser eric-wieser Jun 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Divide-by-zero for:

class S(ctypes.Structure): _fields_ = []

(S*10)()

bpo13881

@serhiy-storchaka serhiy-storchaka removed their assignment Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants