From 8fff1e48214bb7ba624b6f29c16d12d67691a927 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 26 Oct 2000 08:25:43 +0000 Subject: [PATCH] Fix a segfault (addr->error was unpredictable following a dotted-dec lookup) [originally from svn r768] --- winnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winnet.c b/winnet.c index f80d8806..e36d9e16 100644 --- a/winnet.c +++ b/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; }