Skip to content

[Skip Issue] Fix a possible crash due to range_reverse()#10252

Merged
serhiy-storchaka merged 1 commit into
python:masterfrom
ZackerySpytz:range_reverse-crash
Oct 31, 2018
Merged

[Skip Issue] Fix a possible crash due to range_reverse()#10252
serhiy-storchaka merged 1 commit into
python:masterfrom
ZackerySpytz:range_reverse-crash

Conversation

@ZackerySpytz

Copy link
Copy Markdown
Contributor

If any of the PyNumber_* calls fail while the new iterator object is being prepared, a crash will occur during deallocation.

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There was an assumption that PyObject_New() fills memory with zeros. Some of object-creating methods do this, but not in this case.

@miss-islington

Copy link
Copy Markdown
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.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 31, 2018
(cherry picked from commit c9a6168)

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

Copy link
Copy Markdown

GH-10256 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 31, 2018
(cherry picked from commit c9a6168)

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

Copy link
Copy Markdown

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

miss-islington added a commit that referenced this pull request Oct 31, 2018
(cherry picked from commit c9a6168)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
miss-islington added a commit that referenced this pull request Oct 31, 2018
(cherry picked from commit c9a6168)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants