diff options
author | Manish Katiyar <mkatiyar@gmail.com> | 2008-10-01 19:42:57 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-10-01 19:42:57 -0400 |
commit | 520a17729242e11408df6bd73c873860b63988bf (patch) | |
tree | f026aead85a7bbcc7dcb9c3532d584f0e96ada70 | |
parent | 03206bd82580b5d5bf491c9465d61e7b27d38c46 (diff) | |
download | e2fsprogs-520a17729242e11408df6bd73c873860b63988bf.tar.gz |
resize2fs: Fix potential memory corruption in ext2fs_progress_init()
Check the return value of ext2fs_get_mem, since prog isn't initialized
so checking may miss a failed memory allocation.
Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | resize/sim_progress.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/resize/sim_progress.c b/resize/sim_progress.c index a575633b..e7dba88e 100644 --- a/resize/sim_progress.c +++ b/resize/sim_progress.c @@ -83,7 +83,7 @@ errcode_t ext2fs_progress_init(ext2_sim_progmeter *ret_prog, errcode_t retval; retval = ext2fs_get_mem(sizeof(struct ext2_sim_progress), &prog); - if (!prog) + if (retval) return retval; memset(prog, 0, sizeof(struct ext2_sim_progress)); |