Skip to content

bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl()#9705

Merged
serhiy-storchaka merged 2 commits intopython:masterfrom
ZackerySpytz:bpo-34899-int-from_bytes-crash
Oct 5, 2018
Merged

bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl()#9705
serhiy-storchaka merged 2 commits intopython:masterfrom
ZackerySpytz:bpo-34899-int-from_bytes-crash

Conversation

@ZackerySpytz
Copy link
Contributor

@ZackerySpytz ZackerySpytz commented Oct 4, 2018

The _PyLong_FromByteArray() call in int_from_bytes_impl() was
unchecked.

This is a "skip news" PR.

https://bugs.python.org/issue34899

The _PyLong_FromByteArray() call in int_from_bytes_impl() was
unchecked.
(unsigned char *)PyBytes_AS_STRING(bytes), Py_SIZE(bytes),
little_endian, is_signed);
Py_DECREF(bytes);
if (long_obj == NULL) {
Copy link
Member

Choose a reason for hiding this comment

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

This check can be merged with the following check.

if (long_obj != NULL && type != &PyLong_Type) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

@serhiy-storchaka serhiy-storchaka added needs backport to 3.6 type-bug An unexpected behavior, bug, or error skip news labels Oct 5, 2018
@serhiy-storchaka serhiy-storchaka merged commit 7bb9cd0 into python:master Oct 5, 2018
@miss-islington
Copy link
Contributor

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 5, 2018
…l() (pythonGH-9705)

The _PyLong_FromByteArray() call in int_from_bytes_impl() was
unchecked.
(cherry picked from commit 7bb9cd0)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
@bedevere-bot
Copy link

GH-9729 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 Oct 5, 2018
…l() (pythonGH-9705)

The _PyLong_FromByteArray() call in int_from_bytes_impl() was
unchecked.
(cherry picked from commit 7bb9cd0)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
@bedevere-bot
Copy link

GH-9730 is a backport of this pull request to the 3.6 branch.

miss-islington added a commit that referenced this pull request Oct 5, 2018
…l() (GH-9705)

The _PyLong_FromByteArray() call in int_from_bytes_impl() was
unchecked.
(cherry picked from commit 7bb9cd0)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
miss-islington added a commit that referenced this pull request Oct 5, 2018
…l() (GH-9705)

The _PyLong_FromByteArray() call in int_from_bytes_impl() was
unchecked.
(cherry picked from commit 7bb9cd0)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants