-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-96821: Fix undefined behaviour in _testcapimodule.c
#96915
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
Conversation
_testcapimodule.c
@kumaraditya303 @mdickinson Would you please have a look? |
Misc/NEWS.d/next/Core and Builtins/2022-09-18-08-47-40.gh-issue-96821.Co2iOq.rst
Outdated
Show resolved
Hide resolved
…e-96821.Co2iOq.rst Co-authored-by: C.A.M. Gerlach <[email protected]>
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 think I've wrote similar code before elsewhere (just doing raw pointer arithmetic on an unverified args pointer). However, I don't recall where exactly now :(.
Anyways, thanks this LGTM.
Thanks! |
Thanks @matthiasgoergens for the PR, and @Fidget-Spinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Thanks @matthiasgoergens for the PR, and @Fidget-Spinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
GH-96926 is a backport of this pull request to the 3.10 branch. |
…nGH-96915) * pythongh-96821: Assert for demonstrating undefined behaviour * Fix UB Co-authored-by: C.A.M. Gerlach <[email protected]> (cherry picked from commit cbdeda8) Co-authored-by: Matthias Görgens <[email protected]>
…nGH-96915) * pythongh-96821: Assert for demonstrating undefined behaviour * Fix UB Co-authored-by: C.A.M. Gerlach <[email protected]> (cherry picked from commit cbdeda8) Co-authored-by: Matthias Görgens <[email protected]>
GH-96927 is a backport of this pull request to the 3.11 branch. |
There was an example of this in eg Btw, this kind of null pointer arithmetic is perfectly defined, as long as we compile with |
…H-96926) * gh-96821: Assert for demonstrating undefined behaviour * Fix UB (cherry picked from commit cbdeda8) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Matthias Görgens <[email protected]>
…H-96927) * gh-96821: Assert for demonstrating undefined behaviour * Fix UB (cherry picked from commit cbdeda8) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Matthias Görgens <[email protected]>
…H-96927) * gh-96821: Assert for demonstrating undefined behaviour * Fix UB (cherry picked from commit cbdeda8) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Matthias Görgens <[email protected]>
The first commit demonstrates the undefined behaviour and is meant to fail tests.
The other commits fix it.
-fstrict-overflow
#96821