Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use correct sizeof in ares_getnameinfo()

  • Loading branch information...
commit 22c527cc87438d219fd3a7df73fa54bd6a78a787 1 parent 09f8a05
Jakub Hrozek authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 ares_getnameinfo.c
4 ares_getnameinfo.c
@@ -188,7 +188,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
188 188 if (sa->sa_family == AF_INET)
189 189 {
190 190 niquery->family = AF_INET;
191   - memcpy(&niquery->addr.addr4, addr, sizeof(addr));
  191 + memcpy(&niquery->addr.addr4, addr, sizeof(struct in_addr));
192 192 ares_gethostbyaddr(channel, &addr->sin_addr,
193 193 sizeof(struct in_addr), AF_INET,
194 194 nameinfo_callback, niquery);
@@ -196,7 +196,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
196 196 else
197 197 {
198 198 niquery->family = AF_INET6;
199   - memcpy(&niquery->addr.addr6, addr6, sizeof(addr6));
  199 + memcpy(&niquery->addr.addr6, addr6, sizeof(struct ares_in6_addr));
200 200 ares_gethostbyaddr(channel, &addr6->sin6_addr,
201 201 sizeof(struct ares_in6_addr), AF_INET6,
202 202 nameinfo_callback, niquery);

0 comments on commit 22c527c

Please sign in to comment.
Something went wrong with that request. Please try again.