bpo-38282: Rewrite getsockaddrarg() helper function (GH-16698)

Rewrite getsockaddrarg() helper function of socketmodule.c (_socket
module) to prevent a false alarm when compiling codde using GCC with
_FORTIFY_SOURCE=2. Pass a pointer of the sock_addr_t union, rather
than passing a pointer to a sockaddr structure.

Add "struct sockaddr_tipc tipc;" to the sock_addr_t union.
This commit is contained in:
Victor Stinner 2019-10-10 21:30:20 +02:00 committed by GitHub
parent 1dbe537385
commit d565fb9828
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 39 deletions

View file

@ -261,6 +261,9 @@ typedef union sock_addr {
#ifdef AF_VSOCK
struct sockaddr_vm vm;
#endif
#ifdef HAVE_LINUX_TIPC_H
struct sockaddr_tipc tipc;
#endif
} sock_addr_t;
/* The object holding a socket. It holds some extra information,