summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2011-09-16 15:49:21 -0500
committerTheodore Ts'o <tytso@mit.edu>2011-09-16 18:43:04 -0400
commit665563b825ca697a2b4bdd340760a36f6263709e (patch)
tree7904115dea147a86397e32f29a635847b6d9fd93 /lib
parentd0f196d867504d8461fb7c6958aa6a5d220d5825 (diff)
downloade2fsprogs-665563b825ca697a2b4bdd340760a36f6263709e.tar.gz
libext2fs: Potential null ptr deref in undo_err_handler_init
In the !undo_io_backing_manager case, undo_err_handler_init will be passed a null data->real, which will be dereferenced. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'lib')
-rw-r--r--lib/ext2fs/undo_io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ext2fs/undo_io.c b/lib/ext2fs/undo_io.c
index 454f3b62..da1cf452 100644
--- a/lib/ext2fs/undo_io.c
+++ b/lib/ext2fs/undo_io.c
@@ -400,7 +400,8 @@ static errcode_t undo_open(const char *name, int flags, io_channel *channel)
* setup err handler for read so that we know
* when the backing manager fails do short read
*/
- undo_err_handler_init(data->real);
+ if (data->real)
+ undo_err_handler_init(data->real);
*channel = io;
return 0;