makefs: zero memory

NetBSD revs:
ffs/buf.c	1.14

Obtained from:	NetBSD
This commit is contained in:
Ed Maste 2017-04-06 00:07:11 +00:00
parent ec2408187e
commit 07e89ad740

View File

@ -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, int size, int u1 __unused,
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;
}