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 <[email protected]>
  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) {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to