summary refs log tree commit diff
path: root/nis/nss_nisplus/nisplus-ethers.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-09-25 19:44:55 +0000
committerUlrich Drepper <drepper@redhat.com>2003-09-25 19:44:55 +0000
commit901956a52a8b376daa61730f6560cdaddda4b6e2 (patch)
tree9b1a19dcbd4563fd13a412a0fe37b8d3191b3c56 /nis/nss_nisplus/nisplus-ethers.c
parented91314ee80dfdda09b365c4bb87d338bd43861d (diff)
downloadglibc-901956a52a8b376daa61730f6560cdaddda4b6e2.tar.gz
glibc-901956a52a8b376daa61730f6560cdaddda4b6e2.tar.xz
glibc-901956a52a8b376daa61730f6560cdaddda4b6e2.zip
Update.
	* nis/nis_table.c (nis_list): Always strdup string used with
	ibreq->ibr_name.  Add several NULL pointer checks.

	* nis/nss_nisplus/nisplus-alias.c: Add check for NULL return value
	of nis_list.
	* nis/nss_nisplus/nisplus-ethers.c: Likewise.
	* nis/nss_nisplus/nisplus-grp.c: Likewise.
	* nis/nss_nisplus/nisplus-hosts.c: Likewise.
	* nis/nss_nisplus/nisplus-netgrp.c: Likewise.
	* nis/nss_nisplus/nisplus-network.c: Likewise.
	* nis/nss_nisplus/nisplus-proto.c: Likewise.
	* nis/nss_nisplus/nisplus-publickey.c: Likewise.
	* nis/nss_nisplus/nisplus-pwd.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-ethers.c')
-rw-r--r--nis/nss_nisplus/nisplus-ethers.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/nis/nss_nisplus/nisplus-ethers.c b/nis/nss_nisplus/nisplus-ethers.c
index 2fd152dfdb..028309c841 100644
--- a/nis/nss_nisplus/nisplus-ethers.c
+++ b/nis/nss_nisplus/nisplus-ethers.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,2000,2001,2002,2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997.
 
@@ -237,6 +237,11 @@ _nss_nisplus_gethostton_r (const char *name, struct etherent *eth,
 
       result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
 
+      if (result == NULL)
+	{
+	  *errnop = ENOMEM;
+	  return NSS_STATUS_TRYAGAIN;
+	}
       if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
 	{
 	  enum nss_status status = niserr2nss (result->status);
@@ -294,6 +299,11 @@ _nss_nisplus_getntohost_r (const struct ether_addr *addr,
 
       result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
 
+      if (result == NULL)
+	{
+	  *errnop = ENOMEM;
+	  return NSS_STATUS_TRYAGAIN;
+	}
       if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
 	{
 	  enum nss_status status = niserr2nss (result->status);