gaih_addrtuple.addr has room for an IPv6 address, while IPv4 uses only
the first struct in_addr. Express the remaining range directly in terms
of that type so static analysis can prove the access remains within the
array.
CID#
1663899
Follow-up for
2d85bba6b9ddd20b74992c740fab7f82c9c03f01
for (const struct gaih_addrtuple *it = tuples; it; it = it->next)
if (it->family == AF_INET)
assert_se(memeqzero(
- (const uint8_t*) it->addr + FAMILY_ADDRESS_SIZE(AF_INET),
- sizeof(it->addr) - FAMILY_ADDRESS_SIZE(AF_INET)));
+ (const uint8_t*) it->addr + sizeof(struct in_addr),
+ sizeof(it->addr) - sizeof(struct in_addr)));
}
static void print_struct_hostent(struct hostent *host, const char *canon) {