Skip to content

Possible null pointer dereference of freevars in _PyCompile_LookupArg #126238

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

Closed
federicovalenso opened this issue Oct 31, 2024 · 4 comments
Closed
Labels
3.12 only security fixes 3.13 bugs and security fixes 3.14 bugs and security fixes easy interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@federicovalenso
Copy link
Contributor

federicovalenso commented Oct 31, 2024

Bug report

Bug description:

freevars is checked for null, but later possible dereference happens. Maybe replacing Py_DECREF by Py_XDECREF should do the trick.

CPython versions tested on:

3.11

Operating systems tested on:

No response

Linked PRs

@federicovalenso federicovalenso added the type-bug An unexpected behavior, bug, or error label Oct 31, 2024
@federicovalenso
Copy link
Contributor Author

FYI @sobolevn

@ZeroIntensity ZeroIntensity added interpreter-core (Objects, Python, Grammar, and Parser dirs) easy type-crash A hard crash of the interpreter, possibly with a core dump 3.12 only security fixes 3.13 bugs and security fixes 3.14 bugs and security fixes and removed type-bug An unexpected behavior, bug, or error labels Oct 31, 2024
@ZeroIntensity
Copy link
Member

Yeah, that looks incorrect. Simply changing it to Py_XDECREF should work. PR welcome :)

sobolevn pushed a commit that referenced this issue Nov 5, 2024
…mpile_LookupArg (#126239)

* Replace Py_DECREF by Py_XDECREF

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <[email protected]>
federicovalenso added a commit to federicovalenso/cpython that referenced this issue Nov 6, 2024
…vars in _PyCompile_LookupArg (pythonGH-126239)

* Replace Py_DECREF by Py_XDECREF

(cherry picked from commit 8525c93)

Co-authored-by: Valery Fedorenko <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <[email protected]>
federicovalenso added a commit to federicovalenso/cpython that referenced this issue Nov 6, 2024
…vars in _PyCompile_LookupArg (pythonGH-126239)

* Replace Py_DECREF by Py_XDECREF

(cherry picked from commit 8525c93)

Co-authored-by: Valery Fedorenko <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Nov 6, 2024

GH-126474 is a backport of this pull request to the 3.12 branch.

@bedevere-app
Copy link

bedevere-app bot commented Nov 6, 2024

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

sobolevn pushed a commit that referenced this issue Nov 6, 2024
…e_LookupArg (gh-126238) (#126474)

[3.12] gh-126238: Fix possible null pointer dereference of freevars in _PyCompile_LookupArg (GH-126239)

* Replace Py_DECREF by Py_XDECREF

(cherry picked from commit 8525c93)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <[email protected]>
@sobolevn sobolevn closed this as completed Nov 6, 2024
sobolevn pushed a commit that referenced this issue Nov 6, 2024
…e_LookupArg (gh-126238) (#126475)

[3.13] gh-126238: Fix possible null pointer dereference of freevars in _PyCompile_LookupArg (GH-126239)

* Replace Py_DECREF by Py_XDECREF

(cherry picked from commit 8525c93)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <[email protected]>
picnixz pushed a commit to picnixz/cpython that referenced this issue Dec 8, 2024
… _PyCompile_LookupArg (python#126239)

* Replace Py_DECREF by Py_XDECREF

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <[email protected]>
ebonnal pushed a commit to ebonnal/cpython that referenced this issue Jan 12, 2025
… _PyCompile_LookupArg (python#126239)

* Replace Py_DECREF by Py_XDECREF

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 only security fixes 3.13 bugs and security fixes 3.14 bugs and security fixes easy interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

3 participants