-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-134885: zstd: Use Py_XSETREF #134886
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-134885: zstd: Use Py_XSETREF #134886
Conversation
0883964
to
3f30ed4
Compare
@@ -1,6 +1,5 @@ | |||
import ctypes | |||
import unittest | |||
import warnings |
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.
Py_XSETREF()
LGTM, but this ctypes correction looks like an accident.
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.
CI was broken on main (the import is unused), and since it's a small change I figured I might as well include 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.
It seems like the change is excluded from this PR since f49a07b already applied it, which is good for 3.14.
Thanks @JelleZijlstra for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
(cherry picked from commit 45c6c48) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
GH-134922 is a backport of this pull request to the 3.14 branch. |
As the Py_SETREF macro explains, the previous code is theoretically vulnerable to a bug where if the destructor for the previous value of
mod_state->CParameter_type
accesses this module, it may see a garbage value there.