Skip to content

Commit

Permalink
* nis/nss_nisplus/nisplus-publickey.c (parse_grp_str): PIDLIST is
Browse files Browse the repository at this point in the history
	supposed to have NGRPS elements.
  • Loading branch information
Ulrich Drepper committed Apr 30, 2006
1 parent ac05397 commit 5493f3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
8 changes: 6 additions & 2 deletions nis/nss_nisplus/nisplus-publickey.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5493f3d

Please sign in to comment.