Skip to content

bpo-42412: Fix possible leaks and check arguments in PyType_FromModuleAndSpec() #23410

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

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Nov 19, 2020

  • There are leaks if Py_tp_bases is used more than once and if some some calls before setting tp_bases are failed.
  • There is a crash if the bases argument or the Py_tp_bases slot is not a tuple.
  • The documentation is not accurate.

https://bugs.python.org/issue42412

…eAndSpec()

* There were leaks if Py_tp_bases is used more than once or if some call is
  failed before setting tp_bases.
* There was a crash if the bases argument or the Py_tp_bases slot is not a tuple.
* The documentation was not accurate.
@serhiy-storchaka serhiy-storchaka force-pushed the PyType_FromModuleAndSpec-bases branch from 9417256 to 18494c4 Compare November 21, 2020 09:39
@serhiy-storchaka serhiy-storchaka merged commit 1db7639 into python:master Nov 21, 2020
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the PyType_FromModuleAndSpec-bases branch November 21, 2020 10:02
@miss-islington
Copy link
Contributor

Sorry @serhiy-storchaka, I had trouble checking out the 3.9 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 1db76394ea79030aa4ed5349c950f6c6da51450f 3.9

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 21, 2020
…eAndSpec() (pythonGH-23410)

* There were leaks if Py_tp_bases is used more than once or if some call is
  failed before setting tp_bases.
* There was a crash if the bases argument or the Py_tp_bases slot is not a tuple.
* The documentation was not accurate.
(cherry picked from commit 1db7639)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot
Copy link

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

@serhiy-storchaka serhiy-storchaka added needs backport to 3.9 only security fixes and removed needs backport to 3.9 only security fixes labels Nov 21, 2020
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 21, 2020
…eAndSpec() (pythonGH-23410)

* There were leaks if Py_tp_bases is used more than once or if some call is
  failed before setting tp_bases.
* There was a crash if the bases argument or the Py_tp_bases slot is not a tuple.
* The documentation was not accurate.
(cherry picked from commit 1db7639)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Nov 21, 2020
@bedevere-bot
Copy link

GH-23442 is a backport of this pull request to the 3.9 branch.

miss-islington added a commit that referenced this pull request Nov 21, 2020
…eAndSpec() (GH-23410)

* There were leaks if Py_tp_bases is used more than once or if some call is
  failed before setting tp_bases.
* There was a crash if the bases argument or the Py_tp_bases slot is not a tuple.
* The documentation was not accurate.
(cherry picked from commit 1db7639)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington added a commit that referenced this pull request Nov 21, 2020
…eAndSpec() (GH-23410)

* There were leaks if Py_tp_bases is used more than once or if some call is
  failed before setting tp_bases.
* There was a crash if the bases argument or the Py_tp_bases slot is not a tuple.
* The documentation was not accurate.
(cherry picked from commit 1db7639)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchaka serhiy-storchaka removed their assignment Dec 29, 2020
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…eAndSpec() (pythonGH-23410)

* There were leaks if Py_tp_bases is used more than once or if some call is
  failed before setting tp_bases.
* There was a crash if the bases argument or the Py_tp_bases slot is not a tuple.
* The documentation was not accurate.
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.

4 participants