diff options
author | Daniel Eischen <deischen@FreeBSD.org> | 2013-02-01 05:19:49 +0000 |
---|---|---|
committer | Daniel Eischen <deischen@FreeBSD.org> | 2013-02-01 05:19:49 +0000 |
commit | cbfb9c649bd7eecce96516a347e4bab7c5b2cb52 (patch) | |
tree | 2c203b024b5ee228a19cdf4a7d7ea3b6538cbbbf /pw/pw_user.c | |
parent | d7373c8a000652837c2eb015ac41c7fd88799934 (diff) | |
download | pw-darwin-cbfb9c649bd7eecce96516a347e4bab7c5b2cb52.tar.gz pw-darwin-cbfb9c649bd7eecce96516a347e4bab7c5b2cb52.tar.zst pw-darwin-cbfb9c649bd7eecce96516a347e4bab7c5b2cb52.zip |
Prevent a null pointer dereference in pw userdel when deleting
a user whose group != username.
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r-- | pw/pw_user.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c index 38f21ce..5f4d7a9 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -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) { |