Prevent a null pointer dereference in pw userdel when deleting
a user whose group != username.
This commit is contained in:
parent
2b89a04496
commit
605e5bbc41
@ -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