summaryrefslogtreecommitdiff
path: root/ares_getnameinfo.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-06-14 19:04:23 +0200
committerJakub Hrozek <jhrozek@redhat.com>2011-06-14 19:04:23 +0200
commit22c527cc87438d219fd3a7df73fa54bd6a78a787 (patch)
tree35b990d1622b4769f8d87532d7d0274e511f4a96 /ares_getnameinfo.c
parent09f8a05573e3b94c50f0f8f72e39c48f24b7cf43 (diff)
downloadc-ares-22c527cc87438d219fd3a7df73fa54bd6a78a787.tar.gz
c-ares-22c527cc87438d219fd3a7df73fa54bd6a78a787.tar.bz2
c-ares-22c527cc87438d219fd3a7df73fa54bd6a78a787.zip
Use correct sizeof in ares_getnameinfo()
Diffstat (limited to 'ares_getnameinfo.c')
-rw-r--r--ares_getnameinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ares_getnameinfo.c b/ares_getnameinfo.c
index c0d2e18..82e261d 100644
--- a/ares_getnameinfo.c
+++ b/ares_getnameinfo.c
@@ -188,7 +188,7 @@ 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);
@@ -196,7 +196,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
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);