Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Feb 2013 05:19:50 +0000 (UTC)
From:      Daniel Eischen <deischen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r246192 - head/usr.sbin/pw
Message-ID:  <201302010519.r115Jorx076262@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: deischen
Date: Fri Feb  1 05:19:49 2013
New Revision: 246192
URL: http://svnweb.freebsd.org/changeset/base/246192

Log:
  Prevent a null pointer dereference in pw userdel when deleting
  a user whose group != username.

Modified:
  head/usr.sbin/pw/pw_user.c

Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c	Fri Feb  1 03:49:09 2013	(r246191)
+++ head/usr.sbin/pw/pw_user.c	Fri Feb  1 05:19:49 2013	(r246192)
@@ -425,7 +425,7 @@ pw_user(struct userconf * cnf, int mode,
 			}
 
 			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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302010519.r115Jorx076262>