diff options
author | Martin Natano <natano@cvs.openbsd.org> | 2016-10-22 10:03:53 +0000 |
---|---|---|
committer | Martin Natano <natano@cvs.openbsd.org> | 2016-10-22 10:03:53 +0000 |
commit | 6d559b373bdbc032b3d8dc7e60da9da66c8bf05e (patch) | |
tree | 8e4294d5f09c5d1445c20129352e37d46eea03b5 /usr.sbin | |
parent | ea4ada24f3328a49fc84dcde735ee0da864caeda (diff) |
Avoid writing pointers to the disk (image).
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/makefs/ffs/mkfs.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/makefs/ffs/mkfs.c b/usr.sbin/makefs/ffs/mkfs.c index 234fec118c8..8b0bb88a395 100644 --- a/usr.sbin/makefs/ffs/mkfs.c +++ b/usr.sbin/makefs/ffs/mkfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkfs.c,v 1.7 2016/10/21 09:43:50 natano Exp $ */ +/* $OpenBSD: mkfs.c,v 1.8 2016/10/22 10:03:52 natano Exp $ */ /* $NetBSD: mkfs.c,v 1.34 2016/06/24 19:24:11 christos Exp $ */ /* @@ -529,10 +529,16 @@ void ffs_write_superblock(struct fs *fs, const fsinfo_t *fsopts) { int cylno, size, blks, i; + struct fs *fsdup; void *space; char *wrbuf; memcpy(writebuf, fs, SBLOCKSIZE); + + fsdup = (struct fs *)writebuf; + fsdup->fs_csp = NULL; + fsdup->fs_maxcluster = NULL; + ffs_wtfs(fs->fs_sblockloc / sectorsize, SBLOCKSIZE, writebuf, fsopts); /* Write out the duplicate super blocks */ |