+2005-01-05 Theodore Ts'o <tytso@mit.edu>
+
+ * dupfs.c (ext2fs_dup_handle): Make sure the new filesystem handle
+ has its own copy of the orig_super data structure. (This
+ is a better way of fixing a double-free problem in
+ resize2fs which Fedora attempted to fix in
+ e2fsprogs-1.35-double_free.patch. Addresses Red Hat
+ Bugzilla #132707.)
+
2004-12-23 Theodore Ts'o <tytso@mit.edu>
* inode.c (ext2fs_flush_icache): When flushing the icache, clear
/*
* dupfs.c --- duplicate a ext2 filesystem handle
*
- * Copyright (C) 1997 Theodore Ts'o.
+ * Copyright (C) 1997, 1998, 2001, 2003, 2005 by Theodore Ts'o.
*
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
*fs = *src;
fs->device_name = 0;
fs->super = 0;
+ fs->orig_super = 0;
fs->group_desc = 0;
fs->inode_map = 0;
fs->block_map = 0;
goto errout;
memcpy(fs->super, src->super, SUPERBLOCK_SIZE);
+ retval = ext2fs_get_mem(SUPERBLOCK_SIZE, &fs->orig_super);
+ if (retval)
+ goto errout;
+ memcpy(fs->orig_super, src->orig_super, SUPERBLOCK_SIZE);
+
retval = ext2fs_get_mem((size_t) fs->desc_blocks * fs->blocksize,
&fs->group_desc);
if (retval)