From ecfc865a4b265df49f839944cf18425ead93149e Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Fri, 18 Oct 2002 23:17:30 +0000 Subject: [PATCH] Bound the size of the superblock to SBLOCKSIZE. Submitted by: BOUWSMA Beery Sponsored by: DARPA & NAI Labs. --- sbin/newfs/mkfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 90561ef02d56..ff3736844f90 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -382,6 +382,8 @@ mkfs(struct partition *pp, char *fsys) if (fscs == NULL) errx(31, "calloc failed"); sblock.fs_sbsize = fragroundup(&sblock, sizeof(struct fs)); + if (sblock.fs_sbsize > SBLOCKSIZE) + sblock.fs_sbsize = SBLOCKSIZE; sblock.fs_minfree = minfree; sblock.fs_maxbpg = maxbpg; sblock.fs_optim = opt;