From owner-svn-src-all@FreeBSD.ORG Fri Dec 28 20:19:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3330CCA; Fri, 28 Dec 2012 20:19:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D91BF8FC12; Fri, 28 Dec 2012 20:19:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBSKJs4E096000; Fri, 28 Dec 2012 20:19:54 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBSKJsXi095999; Fri, 28 Dec 2012 20:19:54 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201212282019.qBSKJsXi095999@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 28 Dec 2012 20:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244777 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2012 20:19:55 -0000 Author: bapt Date: Fri Dec 28 20:19:54 2012 New Revision: 244777 URL: http://svnweb.freebsd.org/changeset/base/244777 Log: Do not leave parts of the new group uninitialized in gr_dup(). Submitted by: Christoph Mallon Reported by: pjd Modified: head/lib/libutil/gr_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Fri Dec 28 19:02:28 2012 (r244776) +++ head/lib/libutil/gr_util.c Fri Dec 28 20:19:54 2012 (r244777) @@ -461,10 +461,14 @@ gr_dup(const struct group *gr) if (gr->gr_name != NULL) { newgr->gr_name = dst; dst = stpcpy(dst, gr->gr_name) + 1; + } else { + newgr->gr_name = NULL; } if (gr->gr_passwd != NULL) { newgr->gr_passwd = dst; dst = stpcpy(dst, gr->gr_passwd) + 1; + } else { + newgr->gr_passwd = NULL; } newgr->gr_gid = gr->gr_gid; if (gr->gr_mem != NULL) {