diff options
-rw-r--r-- | ares/ares__get_hostent.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ares/ares__get_hostent.c b/ares/ares__get_hostent.c index d98af9283..4371c5bf7 100644 --- a/ares/ares__get_hostent.c +++ b/ares/ares__get_hostent.c @@ -189,9 +189,9 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) if (!hostent->h_addr_list[0]) break; if (addrfam == AF_INET) - memcpy(hostent->h_addr_list[0], &addr, addrlen); + memcpy(hostent->h_addr_list[0], &addr, sizeof(struct in_addr)); else - memcpy(hostent->h_addr_list[0], &addr6, addrlen); + memcpy(hostent->h_addr_list[0], &addr6, sizeof(struct in6_addr)); /* Copy aliases. */ hostent->h_aliases = malloc((((size_t)naliases) + 1) * sizeof(char *)); |