mirror of https://github.com/aria2/aria2
2009-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Copied in_addr instead of just casting from char* which might violate strict aliasing rules. * src/AsyncNameResolver.ccpull/1/head
parent
7b63e121c7
commit
928de09345
|
@ -1,3 +1,9 @@
|
|||
2009-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Copied in_addr instead of just casting from char* which might
|
||||
violate strict aliasing rules.
|
||||
* src/AsyncNameResolver.cc
|
||||
|
||||
2009-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Use dynamic_pointer_cast
|
||||
|
|
|
@ -56,8 +56,9 @@ void callback(void* arg, int status, struct hostent* host)
|
|||
return;
|
||||
}
|
||||
for(char** ap = host->h_addr_list; *ap; ++ap) {
|
||||
resolverPtr->_resolvedAddresses.push_back
|
||||
(inet_ntoa(*reinterpret_cast<struct in_addr*>(*ap)));
|
||||
struct in_addr addr;
|
||||
memcpy(&addr, *ap, sizeof(in_addr));
|
||||
resolverPtr->_resolvedAddresses.push_back(inet_ntoa(addr));
|
||||
}
|
||||
resolverPtr->status = AsyncNameResolver::STATUS_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue