1
0
mirror of https://github.com/moparisthebest/curl synced 2025-01-09 04:58:00 -05:00

connect: use CURL_SA_FAMILY_T for portability

Reported-by: Kevin R. Bulgrien
Bug: https://curl.se/mail/lib-2021-04/0071.html

Closes #6918
This commit is contained in:
Daniel Stenberg 2021-04-19 23:28:12 +02:00
parent 04488851e2
commit 355aae5b7f
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -660,7 +660,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
#endif #endif
#if defined(HAVE_SYS_UN_H) && defined(AF_UNIX) #if defined(HAVE_SYS_UN_H) && defined(AF_UNIX)
case AF_UNIX: case AF_UNIX:
if(salen > (curl_socklen_t)sizeof(sa_family_t)) { if(salen > (curl_socklen_t)sizeof(CURL_SA_FAMILY_T)) {
su = (struct sockaddr_un*)sa; su = (struct sockaddr_un*)sa;
msnprintf(addr, MAX_IPADR_LEN, "%s", su->sun_path); msnprintf(addr, MAX_IPADR_LEN, "%s", su->sun_path);
} }