Permalink
Browse files

Use correct sizeof in ares_getnameinfo()

  • Loading branch information...
1 parent 09f8a05 commit 22c527cc87438d219fd3a7df73fa54bd6a78a787 @jhrozek jhrozek committed Jun 14, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 ares_getnameinfo.c
View
4 ares_getnameinfo.c
@@ -188,15 +188,15 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
if (sa->sa_family == AF_INET)
{
niquery->family = AF_INET;
- memcpy(&niquery->addr.addr4, addr, sizeof(addr));
+ memcpy(&niquery->addr.addr4, addr, sizeof(struct in_addr));
ares_gethostbyaddr(channel, &addr->sin_addr,
sizeof(struct in_addr), AF_INET,
nameinfo_callback, niquery);
}
else
{
niquery->family = AF_INET6;
- memcpy(&niquery->addr.addr6, addr6, sizeof(addr6));
+ memcpy(&niquery->addr.addr6, addr6, sizeof(struct ares_in6_addr));
ares_gethostbyaddr(channel, &addr6->sin6_addr,
sizeof(struct ares_in6_addr), AF_INET6,
nameinfo_callback, niquery);

0 comments on commit 22c527c

Please sign in to comment.