# HG changeset patch # User tytso@mit.edu # Date 1170006028 18000 # Node ID 1619c81226d196f7e943e96b1ecc80c477dc7806 # Parent 61145b06a34c8a476827e02fd0a8c7c95a2ad912 Fix dump_usued segault in debugfs if used without open filesystem The dump_unused command in debugfs segfaults if used without an open filesystem: sor:~ # debugfs debugfs 1.39 (29-May-2006) debugfs: dump_unused Segmentation fault Patch (from IBM) below. Signed-off-by: Matthias Koenig <mkoenig@suse.de> Index: e2fsprogs-1.39-RHEL5/debugfs/ChangeLog =================================================================== --- e2fsprogs-1.39-RHEL5.orig/debugfs/ChangeLog +++ e2fsprogs-1.39-RHEL5/debugfs/ChangeLog @@ -24,6 +24,11 @@ to avoid the possibility of an array overrun if the filename is exactly EXT2_NAME_LEN in size. +2007-01-28 Theodore Tso <tytso@mit.edu> + + * unused.c: Fix bug so that the dump_unused command segfault if + used without an open filesystem + 2006-08-30 Eric Sandeen <esandeen@redhat.com> * htree.c (htree_dump_int_node): Fix printf formats. Index: e2fsprogs-1.39-RHEL5/debugfs/unused.c =================================================================== --- e2fsprogs-1.39-RHEL5.orig/debugfs/unused.c +++ e2fsprogs-1.39-RHEL5/debugfs/unused.c @@ -31,6 +31,10 @@ void do_dump_unused(int argc EXT2FS_ATTR unsigned int i; errcode_t retval; + if (common_args_process(argc, argv, 1, 1, + "dump_unused", "", 0)) + return; + for (blk=current_fs->super->s_first_data_block; blk < current_fs->super->s_blocks_count; blk++) { if (ext2fs_test_block_bitmap(current_fs->block_map,blk))