about summary refs log tree commit diff
path: root/nis
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-04-30 15:36:48 +0000
committerUlrich Drepper <drepper@redhat.com>2006-04-30 15:36:48 +0000
commit5493f3ddc38e5cc961b03655de17f654eb5d8533 (patch)
tree0a3cac9d1d3b7e4e27cdbafa9e87546416da3043 /nis
parentac05397075f621cfdbe1db527c96167a58b6d18e (diff)
downloadglibc-5493f3ddc38e5cc961b03655de17f654eb5d8533.tar.gz
glibc-5493f3ddc38e5cc961b03655de17f654eb5d8533.tar.xz
glibc-5493f3ddc38e5cc961b03655de17f654eb5d8533.zip
* nis/nss_nisplus/nisplus-publickey.c (parse_grp_str): PIDLIST is
	supposed to have NGRPS elements.
Diffstat (limited to 'nis')
-rw-r--r--nis/nss_nisplus/nisplus-publickey.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/nis/nss_nisplus/nisplus-publickey.c b/nis/nss_nisplus/nisplus-publickey.c
index fe269b2c48..f6b32f8827 100644
--- a/nis/nss_nisplus/nisplus-publickey.c
+++ b/nis/nss_nisplus/nisplus-publickey.c
@@ -226,8 +226,12 @@ parse_grp_str (const char *s, gid_t *gidp, int *gidlenp, gid_t *gidlist,
   gidlen = 0;
 
   /* After strtoul() ep should point to the marker ',', which means
-     here starts a new value. */
-  while (ep != NULL && *ep == ',')
+     here starts a new value.
+
+     The Sun man pages show that GIDLIST should contain at least NGRPS
+     elements.  Limiting the number written by this value is the best
+     we can do.  */
+  while (ep != NULL && *ep == ',' && gidlen < NGRPS)
     {
       ep++;
       s = ep;