From dc578f2564fae6ef712bf6c8f228078a80aa5569 Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Mon, 3 Jul 2000 02:33:02 +0000 Subject: [PATCH] Fix a nasty bug which would leave the struct hostent incompletely filled out when parsing certain DNS records during a reverse address resolution. Thus when code tries to examine the returned host name, it dereferences a null pointer :-( Problem noticed by: ps --- lib/libc/net/name6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c index 32fe460f4155..2368d8235b2a 100644 --- a/lib/libc/net/name6.c +++ b/lib/libc/net/name6.c @@ -1185,7 +1185,7 @@ getanswer(answer, anslen, qname, qtype, template, errp) continue; } strcpy(bp, tbuf); - tname = bp; + template->h_name = bp; bp += n; buflen -= n; continue;