Prevent a null pointer dereference in pw userdel when deleting

a user whose group != username.
This commit is contained in:
deischen 2013-02-01 05:19:49 +00:00
parent 81de6f5cc4
commit bb6c47e42f

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) {