From 605e5bbc41f9c3b1b828ea2cbc2e31f9fce50d81 Mon Sep 17 00:00:00 2001 From: Daniel Eischen Date: Fri, 1 Feb 2013 05:19:49 +0000 Subject: [PATCH] Prevent a null pointer dereference in pw userdel when deleting a user whose group != username. --- usr.sbin/pw/pw_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 38f21cee61a..5f4d7a99252 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) {