Don't forget to initialise ret->ai to NULL in sk_nonamelookup. Was

causing segfaults in IPv6-enabled Unix PuTTY connecting through a
proxy when letting the proxy do the DNS.

[originally from svn r5064]
This commit is contained in:
Simon Tatham 2005-01-04 17:39:35 +00:00
Родитель 8053aea360
Коммит e6dd93c25a
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -209,6 +209,9 @@ SockAddr sk_nonamelookup(const char *host)
ret->family = AF_UNSPEC;
strncpy(ret->hostname, host, lenof(ret->hostname));
ret->hostname[lenof(ret->hostname)-1] = '\0';
#ifndef NO_IPV6
ret->ai = NULL;
#endif
return ret;
}