[PATCH] tune2fs: prevent crash if error in journal recovery

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Prevent coredump if tunefs calls ext2fs_run_ext3_journal(), and this then
fails for some reason while calling ext2fs_open2(). Such failure makes
the fs pointer NULL.

Signed-off-by: Erkki Ruohtula <eru@xxxxxxxx>
---

diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index ecba2ea..6538032 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -3367,6 +3367,9 @@ closefs:
 #endif
 	}

-	convert_64bit(fs, feature_64bit);
-	return (ext2fs_close_free(&fs) ? 1 : 0);
+	if (fs) {
+		convert_64bit(fs, feature_64bit);
+		return (ext2fs_close_free(&fs) ? 1 : 0);
+	}
+	return 1;
 }





[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux