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