bpo-38282: Rewrite getsockaddrarg() helper function#16698
Conversation
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.
|
@nanjekyejoannah @pablogsal @pitrou @tiran: Would you mind to review this change? |
Sorry, something went wrong.
|
I tested manually that this change fix the GCC compiler warning when using: |
Sorry, something went wrong.
pitrou
left a comment
There was a problem hiding this comment.
LGTM. A bit cleaner too.
Sorry, something went wrong.
It helps static analyzers to follow the size of the storage. |
Sorry, something went wrong.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry, something went wrong.
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. (cherry picked from commit d565fb9) Co-authored-by: Victor Stinner <vstinner@python.org>
|
There are failures on FreeBSD. I close the 3.8 backport. |
Sorry, something went wrong.
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.
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.
https://bugs.python.org/issue38282