about summary refs log tree commit diff
path: root/sunrpc/getrpcport.c
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc/getrpcport.c')
-rw-r--r--sunrpc/getrpcport.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sunrpc/getrpcport.c b/sunrpc/getrpcport.c
index 188c668c1d..2e12482abc 100644
--- a/sunrpc/getrpcport.c
+++ b/sunrpc/getrpcport.c
@@ -56,7 +56,8 @@ getrpcport (const char *host, u_long prognum, u_long versnum, u_int proto)
 
   buflen = 1024;
   buffer = __alloca (buflen);
-  while (__gethostbyname_r (host, &hostbuf, buffer, buflen, &hp, &herr) != 0)
+  while (__gethostbyname_r (host, &hostbuf, buffer, buflen, &hp, &herr) != 0
+	 || hp == NULL)
     if (herr != NETDB_INTERNAL || errno != ERANGE)
       return 0;
     else