Prevent a null pointer dereference in pw userdel when deleting
a user whose group != username.
This commit is contained in:
parent
81de6f5cc4
commit
bb6c47e42f
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user