Prevent a null pointer dereference in pw userdel when deleting

a user whose group != username.
This commit is contained in:
Daniel Eischen 2013-02-01 05:19:49 +00:00
parent 2b89a04496
commit 605e5bbc41

View File

@ -425,7 +425,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
}
grp = GETGRNAM(a_name->val);
if (*grp->gr_mem == NULL)
if (grp != NULL && *grp->gr_mem == NULL)
delgrent(GETGRNAM(a_name->val));
SETGRENT();
while ((grp = GETGRENT()) != NULL) {