2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

4373. [bug] Address undefined behaviour in getaddrinfo. [RT #42479]

This commit is contained in:
Mark Andrews
2016-05-26 12:05:37 +10:00
parent 10f8dc8456
commit ede52ba98d
2 changed files with 5 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
4373. [bug] Address undefined behaviour in getaddrinfo. [RT #42479]
4372. [bug] Address undefined behaviour in libt_api. [RT #42480]
4371. [func] New "minimal-any" option reduces the size of UDP

View File

@@ -417,7 +417,7 @@ getaddrinfo(const char *hostname, const char *servname,
goto inet6_addr;
}
addrsize = sizeof(struct in_addr);
addroff = (char *)(&SIN(0)->sin_addr) - (char *)0;
addroff = offsetof(struct sockaddr_in, sin_addr);
family = AF_INET;
goto common;
#ifdef IRS_HAVE_SIN6_SCOPE_ID
@@ -426,7 +426,7 @@ getaddrinfo(const char *hostname, const char *servname,
if (family && family != AF_INET6)
return (EAI_NONAME);
addrsize = sizeof(struct in6_addr);
addroff = (char *)(&SIN6(0)->sin6_addr) - (char *)0;
addroff = offsetof(struct sockaddr_in6, sin6_addr);
family = AF_INET6;
goto common;
#endif
@@ -435,7 +435,7 @@ getaddrinfo(const char *hostname, const char *servname,
return (EAI_NONAME);
inet6_addr:
addrsize = sizeof(struct in6_addr);
addroff = (char *)(&SIN6(0)->sin6_addr) - (char *)0;
addroff = offsetof(struct sockaddr_in6, sin6_addr);
family = AF_INET6;
common: