[PATCH] resize2fs : Fix potential memory corruption in ext2fs_progress_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since "prog" is not initialized with 0 , below check in
ext2fs_progress_init() is wrong and may lead to corruptions.


Signed-off-by: Manish Katiyar <mkatiyar@xxxxxxxxx>

---
 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 a575633..e7dba88 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));

-- 
1.5.4.3


Thanks -
Manish
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux