]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs.c (do_stat): Check to make sure a filesystem is open
authorTheodore Ts'o <tytso@mit.edu>
Thu, 5 May 2005 21:21:46 +0000 (17:21 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 5 May 2005 21:21:46 +0000 (17:21 -0400)
and abort if with an error if not, to prevent a seg fault
in that case.

debugfs/ChangeLog
debugfs/debugfs.c

index fa2a335e2c330e374b378c7e9b7b02cf203da008..994388db7675848ba3737654c8135532d7565841 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-05  Theodore Ts'o  <tytso@mit.edu>
+
+       * debugfs.c (do_stat): Check to make sure a filesystem is open
+               and abort if with an error if not, to prevent a seg fault
+               in that case.
+
 2005-03-21  Theodore Ts'o  <tytso@mit.edu>
 
        * Release of E2fsprogs 1.37
index ca73c993024954384a0b9529a4aa02998e16bdd7..e923403d916fed3956896c2e76ce57de65bfd0d1 100644 (file)
@@ -595,6 +595,9 @@ void do_stat(int argc, char *argv[])
        ext2_ino_t      inode;
        struct ext2_inode * inode_buf;
 
+       if (check_fs_open(argv[0]))
+               return 1;
+
        inode_buf = (struct ext2_inode *)
                        malloc(EXT2_INODE_SIZE(current_fs->super));
        if (!inode_buf) {