Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use correct sizeof in ares_getnameinfo()

  • Loading branch information...
commit 22c527cc87438d219fd3a7df73fa54bd6a78a787 1 parent 09f8a05
Jakub Hrozek authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 ares_getnameinfo.c
4 ares_getnameinfo.c
View
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.