Module Name: src
Committed By: christos
Date: Wed Feb 8 02:20:35 UTC 2017
Modified Files:
src/usr.sbin/makefs: ffs.c
Log Message:
zero out the superblock so that it does not contain random stuff in the
spare fields.
To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.sbin/makefs/ffs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/makefs/ffs.c
diff -u src/usr.sbin/makefs/ffs.c:1.66 src/usr.sbin/makefs/ffs.c:1.67
--- src/usr.sbin/makefs/ffs.c:1.66 Sun Dec 20 19:58:08 2015
+++ src/usr.sbin/makefs/ffs.c Tue Feb 7 21:20:35 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs.c,v 1.66 2015/12/21 00:58:08 christos Exp $ */
+/* $NetBSD: ffs.c,v 1.67 2017/02/08 02:20:35 christos Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs.c,v 1.66 2015/12/21 00:58:08 christos Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.67 2017/02/08 02:20:35 christos Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -294,6 +294,7 @@ ffs_makefs(const char *image, const char
/* update various superblock parameters */
superblock = fsopts->superblock;
+ memset(superblock, 0, sizeof(*superblock));
superblock->fs_fmod = 0;
superblock->fs_old_cstotal.cs_ndir = superblock->fs_cstotal.cs_ndir;
superblock->fs_old_cstotal.cs_nbfree = superblock->fs_cstotal.cs_nbfree;