Skip to content

[3.12] gh-111178: Fix getsockaddrarg() undefined behavior (GH-131668) (GH-131977) #131979

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
merged 1 commit into from
Apr 1, 2025

Conversation

miss-islington
Copy link
Contributor

gh-111178: Fix getsockaddrarg() undefined behavior (GH-131668)

Don't pass direct references to sockaddr members since their type may
not match PyArg_ParseTuple() types. Instead, use temporary 'int' and
'unsigned char' variables, and update sockaddr members afterwards.

On FreeBSD, treat BTPROTO_HCI node name as a bytes string,
not as an integer.
(cherry picked from commit c318a03)

Co-authored-by: Victor Stinner [email protected]
(cherry picked from commit 8cd29c2)

…onGH-131668) (pythonGH-131977)

pythongh-111178: Fix getsockaddrarg() undefined behavior (pythonGH-131668)

Don't pass direct references to sockaddr members since their type may
not match PyArg_ParseTuple() types. Instead, use temporary 'int' and
'unsigned char' variables, and update sockaddr members afterwards.

On FreeBSD, treat BTPROTO_HCI node name as a bytes string,
not as an integer.
(cherry picked from commit c318a03)

Co-authored-by: Victor Stinner <[email protected]>
(cherry picked from commit 8cd29c2)
@vstinner vstinner enabled auto-merge (squash) April 1, 2025 14:45
@vstinner vstinner merged commit afb3f33 into python:3.12 Apr 1, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants