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;
}