]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-111178: Fix getsockaddrarg() undefined behavior (#131668) (#131977)
authorVictor Stinner <vstinner@python.org>
Tue, 1 Apr 2025 14:40:00 +0000 (16:40 +0200)
committerGitHub <noreply@github.com>
Tue, 1 Apr 2025 14:40:00 +0000 (14:40 +0000)
commitc318a03b17c3e58e9c46beb84ab7070b7baa303b
treec5933ab58490cc9ecb129ce71c9d143fe05aec5b
parent05e7fa2c2f74c82fd93ab40fc3abf2be4584c97b
[3.13] gh-111178: Fix getsockaddrarg() undefined behavior (#131668) (#131977)

gh-111178: Fix getsockaddrarg() undefined behavior (#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 8cd29c2b533e5a1a262238695d05f2a7c44d6455)
Misc/NEWS.d/next/Library/2025-03-28-11-26-31.gh-issue-131668.tcS4xS.rst [new file with mode: 0644]
Modules/socketmodule.c