e2fsprogs/e2fsprogs-1.39-dump_unused-segfault.patch
Eric Sandeen 66fd3626d0 * Fri Jun 22 2007 Eric Sandeen <esandeen@redhat.com> 1.39-14
- Many coverity-found potential leaks, segfaults, etc (#239354)
- Fix debugfs segfaults when no fs open (#208416, #209330)
- Avoid recursive loops in logdump due to symlinks in /dev (#210371)
- Don't write changes to the backup superblocks by default (#229561)
- Correct byteswapping for fast symlinks with xattrs (#232663)
- e2fsck: added sanity check for xattr validation (#230193)
2007-06-22 17:04:55 +00:00

52 lines
1.6 KiB
Diff

# 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))