From a2fb4f805732a70c5d824a10dfd87dc5f3cdde60 Mon Sep 17 00:00:00 2001 From: krw Date: Sat, 24 May 2014 02:27:31 +0000 Subject: [PATCH] Don't potentially use stack garbage for e2d_type. Initialize newent.e2d_type to EXT2_FT_UNKNOWN, a.k.a. 0. Spotted by -Wall. --- sbin/fsck_ext2fs/dir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/fsck_ext2fs/dir.c b/sbin/fsck_ext2fs/dir.c index 875f13ffa8b..f24f1675a15 100644 --- a/sbin/fsck_ext2fs/dir.c +++ b/sbin/fsck_ext2fs/dir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.c,v 1.17 2014/05/21 17:52:26 krw Exp $ */ +/* $OpenBSD: dir.c,v 1.18 2014/05/24 02:27:31 krw Exp $ */ /* $NetBSD: dir.c,v 1.5 2000/01/28 16:01:46 bouyer Exp $ */ /* @@ -310,6 +310,7 @@ mkentry(struct inodesc *idesc) struct ext2fs_direct newent; int newlen, oldlen; + newent.e2d_type = EXT2_FT_UNKNOWN; newent.e2d_namlen = strlen(idesc->id_name); if (sblock.e2fs.e2fs_rev > E2FS_REV0 && (sblock.e2fs.e2fs_features_incompat & EXT2F_INCOMPAT_FTYPE)) -- 2.20.1