about summary refs log tree commit diff
path: root/nis/nss_nisplus/nisplus-hosts.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-04-30 05:45:15 +0000
committerUlrich Drepper <drepper@redhat.com>2006-04-30 05:45:15 +0000
commit487609e313750814bf8d99a0390dde7620d55086 (patch)
treee7451ec616e8fce7e96c0e72bffe7dc195986490 /nis/nss_nisplus/nisplus-hosts.c
parentd08a1d404d8b1fb21494fef2a3aff0022ae6de8b (diff)
downloadglibc-487609e313750814bf8d99a0390dde7620d55086.tar.gz
glibc-487609e313750814bf8d99a0390dde7620d55086.tar.xz
glibc-487609e313750814bf8d99a0390dde7620d55086.zip
* nis/nss_nisplus/nisplus-ethers.c: Add missing null pointer check.
	* nis/nss_nisplus/nisplus-hosts.c: Likewise.
	* nis/nss_nisplus/nisplus-network.c: Likewise.
	* nis/nss_nisplus/nisplus-proto.c: Likewise.
	* nis/nss_nisplus/nisplus-rpc.c: Likewise.
	* nis/nss_nisplus/nisplus-service.c: Likewise.
	* nis/nss_nisplus/nisplus-spwd.c: Likewise.
Diffstat (limited to 'nis/nss_nisplus/nisplus-hosts.c')
-rw-r--r--nis/nss_nisplus/nisplus-hosts.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/nis/nss_nisplus/nisplus-hosts.c b/nis/nss_nisplus/nisplus-hosts.c
index 023e18f93d..f5f0ac96da 100644
--- a/nis/nss_nisplus/nisplus-hosts.c
+++ b/nis/nss_nisplus/nisplus-hosts.c
@@ -265,6 +265,11 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer,
 	    }
 
 	  result = nis_first_entry (tablename_val);
+	  if (result == NULL)
+	    {
+	      *errnop = errno;
+	      return NSS_STATUS_TRYAGAIN;
+	    }
 	  if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
             {
               enum nss_status retval = niserr2nss (result->status);
@@ -279,11 +284,13 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer,
 	}
       else
 	{
-	  nis_result *res2;
-
 	  saved_res = result;
-	  res2 = nis_next_entry(tablename_val, &result->cookie);
-	  result = res2;
+	  result = nis_next_entry (tablename_val, &result->cookie);
+	  if (result == NULL)
+	    {
+	      *errnop = errno;
+	      return NSS_STATUS_TRYAGAIN;
+	    }
 	  if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
             {
               enum nss_status retval= niserr2nss (result->status);