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

gh-126654: Fix crash in several functions in _interpreters module #126678

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Nov 11, 2024

This was the cause:

  • We checked that passed arg is not a dict here:

    cpython/Python/crossinterp.c

    Lines 1479 to 1482 in 6ee542d

    if (!PyDict_CheckExact(nsobj)) {
    PyErr_SetString(PyExc_TypeError, "expected a dict");
    return NULL;
    }
  • Later we had an assertion about !PyErr_Occurred()

So, I went with the early validation.

@kumaraditya303 kumaraditya303 added the needs backport to 3.13 bugs and security fixes label Nov 11, 2024
@kumaraditya303 kumaraditya303 merged commit 9fc2808 into python:main Nov 11, 2024
47 checks passed
@miss-islington-app
Copy link

Thanks @sobolevn for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 11, 2024
…dule (pythonGH-126678)

(cherry picked from commit 9fc2808)

Co-authored-by: sobolevn <mail@sobolevn.me>
@bedevere-app
Copy link

bedevere-app bot commented Nov 11, 2024

GH-126681 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 11, 2024
kumaraditya303 pushed a commit that referenced this pull request Nov 11, 2024
…odule (GH-126678) (#126681)

gh-126654: Fix crash in several functions in `_interpreters` module (GH-126678)
(cherry picked from commit 9fc2808)

Co-authored-by: sobolevn <mail@sobolevn.me>
picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants