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.
Py_XSETREF() LGTM, but this ctypes correction looks like an accident.
There was a problem hiding this comment.
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.
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_typeaccesses this module, it may see a garbage value there.