summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2019-12-17 19:41:52 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2019-12-17 19:41:52 +0000
commit2f74ed511702ed2054241532471e960ddc558b93 (patch)
tree163658bf12201a7f33bd039d690bbbdc048f0b51 /sbin
parent974178a7ca7ae75bcaafe1f64f599ac64e67aaad (diff)
Use correct size when zeroing out dinode.
Fixes a bug on file systems using the rev1 inode structure where the size of the in-memory and on-disk dinode differ. From Chris Waddey; OK deraadt@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fsck_ext2fs/pass2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/fsck_ext2fs/pass2.c b/sbin/fsck_ext2fs/pass2.c
index 5f8dce31d27..9e0d204cad5 100644
--- a/sbin/fsck_ext2fs/pass2.c
+++ b/sbin/fsck_ext2fs/pass2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass2.c,v 1.15 2016/04/28 12:17:15 krw Exp $ */
+/* $OpenBSD: pass2.c,v 1.16 2019/12/17 19:41:51 millert Exp $ */
/* $NetBSD: pass2.c,v 1.6 2000/01/28 16:01:46 bouyer Exp $ */
/*
@@ -145,7 +145,7 @@ pass2(void)
inodirty();
}
}
- memset(&dino, 0, EXT2_DINODE_SIZE(&sblock));
+ memset(&dino, 0, sizeof(dino));
dino.e2di_mode = htole16(IFDIR);
inossize(&dino, inp->i_isize);
memcpy(&dino.e2di_blocks[0], &inp->i_blks[0], (size_t)inp->i_numblks);