deal with NULL gr_mem here too

This commit is contained in:
Todd C. Miller
2014-05-06 19:32:34 -06:00
parent e54fe5a269
commit 17cbfea8b7
3 changed files with 11 additions and 9 deletions

View File

@@ -320,7 +320,7 @@ getgrouplist(const char *name, gid_t basegid, gid_t *groups, int *ngroupsp)
setgrent();
while ((grp = getgrent()) != NULL) {
if (grp->gr_gid == basegid)
if (grp->gr_gid == basegid || grp->gr_mem == NULL)
continue;
for (i = 0; grp->gr_mem[i] != NULL; i++) {