* nis/nss_nisplus/nisplus-publickey.c (parse_grp_str): PIDLIST is
authorUlrich Drepper <drepper@redhat.com>
Sun, 30 Apr 2006 15:36:48 +0000 (15:36 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 30 Apr 2006 15:36:48 +0000 (15:36 +0000)
supposed to have NGRPS elements.

ChangeLog
nis/nss_nisplus/nisplus-publickey.c

index 49e28b3..b701bae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-04-30  Ulrich Drepper  <drepper@redhat.com>
 
+       * nis/nss_nisplus/nisplus-publickey.c (parse_grp_str): PIDLIST is
+       supposed to have NGRPS elements.
+
        * nis/nss_nisplus/nisplus-parser.c: Minor optimizations and
        cleanups.  Avoid copying data if it can be used in the old place.
 
index fe269b2..f6b32f8 100644 (file)
@@ -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;