mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-21 13:05:04 -05:00
Martin Prikryl points out that we weren't always initialising new "addrinfo"
members of Windows SockAddr_tag; particular in sk_nonamelookup() (proxy resolution at far end) this was causing trouble. Make sure they _always_ start out NULL (since the Windows getaddrinfo() documentation doesn't make any claims about initialisation), and also initialise 'naddresses' in sk_nonamelookup() for good measure. [originally from svn r5297]
This commit is contained in:
parent
63c26e722a
commit
63784f3f9a
@ -353,6 +353,9 @@ SockAddr sk_namelookup(const char *host, char **canonicalname,
|
|||||||
address_family == ADDRTYPE_IPV6 ? AF_INET6 :
|
address_family == ADDRTYPE_IPV6 ? AF_INET6 :
|
||||||
#endif
|
#endif
|
||||||
AF_UNSPEC);
|
AF_UNSPEC);
|
||||||
|
#ifndef NO_IPV6
|
||||||
|
ret->ai = ret->ais = NULL;
|
||||||
|
#endif
|
||||||
ret_family = AF_UNSPEC;
|
ret_family = AF_UNSPEC;
|
||||||
*realhost = '\0';
|
*realhost = '\0';
|
||||||
|
|
||||||
@ -456,6 +459,10 @@ SockAddr sk_nonamelookup(const char *host)
|
|||||||
SockAddr ret = snew(struct SockAddr_tag);
|
SockAddr ret = snew(struct SockAddr_tag);
|
||||||
ret->error = NULL;
|
ret->error = NULL;
|
||||||
ret->family = AF_UNSPEC;
|
ret->family = AF_UNSPEC;
|
||||||
|
#ifndef NO_IPV6
|
||||||
|
ret->ai = ret->ais = NULL;
|
||||||
|
#endif
|
||||||
|
ret->naddresses = 0;
|
||||||
strncpy(ret->hostname, host, lenof(ret->hostname));
|
strncpy(ret->hostname, host, lenof(ret->hostname));
|
||||||
ret->hostname[lenof(ret->hostname)-1] = '\0';
|
ret->hostname[lenof(ret->hostname)-1] = '\0';
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user