Commit bc1b8032 authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

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.)
parent 6e82cd7e
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
......@@ -33,6 +33,7 @@ errcode_t ext2fs_dup_handle(ext2_filsys src, ext2_filsys *dest)
*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;
......@@ -53,6 +54,11 @@ errcode_t ext2fs_dup_handle(ext2_filsys src, ext2_filsys *dest)
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment