deal with NULL gr_mem

This commit is contained in:
Todd C. Miller
2007-06-21 17:04:26 +00:00
parent f9a6950fbf
commit ae2f7c77ee

View File

@@ -540,9 +540,11 @@ usergr_matches(group, user, pw)
if (grp->gr_gid == user_groups[n]) if (grp->gr_gid == user_groups[n])
return(TRUE); return(TRUE);
} }
if (grp->gr_mem != NULL) {
for (cur = grp->gr_mem; *cur; cur++) for (cur = grp->gr_mem; *cur; cur++)
if (strcmp(*cur, user) == 0) if (strcmp(*cur, user) == 0)
return(TRUE); return(TRUE);
}
return(FALSE); return(FALSE);
} }