зеркало из https://github.com/github/putty.git
Fix a segfault (addr->error was unpredictable following a dotted-dec lookup)
[originally from svn r768]
This commit is contained in:
Родитель
5f73cf092f
Коммит
8fff1e4821
2
winnet.c
2
winnet.c
|
@ -61,6 +61,7 @@ SockAddr sk_namelookup(char *host, char **canonicalname) {
|
|||
unsigned long a;
|
||||
struct hostent *h;
|
||||
|
||||
ret->error = NULL;
|
||||
if ( (a = inet_addr(host)) == (unsigned long) INADDR_NONE) {
|
||||
if ( (h = gethostbyname(host)) == NULL) {
|
||||
DWORD err = WSAGetLastError();
|
||||
|
@ -69,7 +70,6 @@ SockAddr sk_namelookup(char *host, char **canonicalname) {
|
|||
err == WSATRY_AGAIN ? "Host not found" :
|
||||
"gethostbyname: unknown error");
|
||||
} else {
|
||||
ret->error = NULL;
|
||||
memcpy (&a, h->h_addr, sizeof(a));
|
||||
*canonicalname = h->h_name;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче