Date: Fri, 28 Dec 2012 20:19:54 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244777 - head/lib/libutil Message-ID: <201212282019.qBSKJsXi095999@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <christoph.mallon@gmx.de> 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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212282019.qBSKJsXi095999>