-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-126238: Fix possible null pointer dereference of freevars in _PyCompile_LookupArg #126239
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
Merged
sobolevn
merged 4 commits into
python:main
from
federicovalenso:bug/possible-null-pointer-dereference-in-_PyCompile_LookupArg
Nov 5, 2024
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f8940e4
Replace Py_DECREF by Py_XDECREF
federicovalenso 10dcbe0
📜🤖 Added by blurb_it.
blurb-it[bot] 2c8bc0f
Update Misc/NEWS.d/next/Security/2024-10-31-13-14-27.gh-issue-126238.…
federicovalenso 547eca1
Remove news entry due to "skip news" label
federicovalenso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/Security/2024-10-31-13-14-27.gh-issue-126238.CZqaon.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix a possible crash internally when compiling. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -901,7 +901,7 @@ _PyCompile_LookupArg(compiler *c, PyCodeObject *co, PyObject *name) | |
| c->u->u_metadata.u_name, | ||
| co->co_name, | ||
| freevars); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does PyErr_Format work for null? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, |
||
| Py_DECREF(freevars); | ||
| Py_XDECREF(freevars); | ||
| return ERROR; | ||
| } | ||
| return arg; | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to drop this NEWS entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I concur (that's what I did for #126241 because it's a bit hard to phrase it properly and meaningfully).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? This seems user-facing to me, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sobolevn, @picnixz , what's the bottom line? Is news entry required or not?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bottom line in general is whether this kind of bug can be triggered easily using public interface. Unless you have a reproducer saying that with X and Y you can do Z, or unless the interface is publicly documented and known to the outside world, a NEWS entry would be fine. But here, we have neither a test nor is
_PyCompile_LookupArgsomething that is exposed to the world.As an end-user, reading "Fix a possible crash internally when compiling." gives me no information at all except that there was a bug I wasn't aware of (and that it was not always triggerable). I don't know how to make the crash happen, nor do I know what was crashing.