From 1822a5e7ad65bc02126851835a21a2a2d00b5aaa Mon Sep 17 00:00:00 2001 From: jacob Date: Mon, 14 Feb 2005 11:43:27 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.tartarus.org/sgt/putty@5297 cda61777-01e9-0310-a592-d414129be87e --- windows/winnet.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/windows/winnet.c b/windows/winnet.c index 1ddfa5c7..85e7d0c9 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -353,6 +353,9 @@ SockAddr sk_namelookup(const char *host, char **canonicalname, address_family == ADDRTYPE_IPV6 ? AF_INET6 : #endif AF_UNSPEC); +#ifndef NO_IPV6 + ret->ai = ret->ais = NULL; +#endif ret_family = AF_UNSPEC; *realhost = '\0'; @@ -456,6 +459,10 @@ SockAddr sk_nonamelookup(const char *host) SockAddr ret = snew(struct SockAddr_tag); ret->error = NULL; ret->family = AF_UNSPEC; +#ifndef NO_IPV6 + ret->ai = ret->ais = NULL; +#endif + ret->naddresses = 0; strncpy(ret->hostname, host, lenof(ret->hostname)); ret->hostname[lenof(ret->hostname)-1] = '\0'; return ret; -- 2.11.0