svn commit: r316545 - head/usr.sbin/makefs/ffs

Ed Maste emaste at FreeBSD.org
Thu Apr 6 00:07:13 UTC 2017


Author: emaste
Date: Thu Apr  6 00:07:11 2017
New Revision: 316545
URL: https://svnweb.freebsd.org/changeset/base/316545

Log:
  makefs: zero memory
  
  NetBSD revs:
  ffs/buf.c	1.14
  
  Obtained from:	NetBSD

Modified:
  head/usr.sbin/makefs/ffs/buf.c

Modified: head/usr.sbin/makefs/ffs/buf.c
==============================================================================
--- head/usr.sbin/makefs/ffs/buf.c	Wed Apr  5 22:01:49 2017	(r316544)
+++ head/usr.sbin/makefs/ffs/buf.c	Thu Apr  6 00:07:11 2017	(r316545)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "makefs.h"
@@ -219,6 +220,7 @@ getblk(struct vnode *vp, daddr_t blkno, 
 		n = realloc(bp->b_data, size);
 		if (n == NULL)
 			err(1, "getblk: realloc b_data %ld", bp->b_bcount);
+		memset(n, 0, size);
 		bp->b_data = n;
 		bp->b_bufsize = size;
 	}


More information about the svn-src-all mailing list