From: "Manish Katiyar" Subject: Fwd: [PATCH] resize2fs : Fix potential memory corruption in ext2fs_progress_init() Date: Tue, 16 Sep 2008 12:52:55 +0530 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit To: "Theodore Tso" , linux-ext4@vger.kernel.org Return-path: Received: from ti-out-0910.google.com ([209.85.142.191]:52693 "EHLO ti-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752247AbYIPHW6 (ORCPT ); Tue, 16 Sep 2008 03:22:58 -0400 Received: by ti-out-0910.google.com with SMTP id b6so1385022tic.23 for ; Tue, 16 Sep 2008 00:22:56 -0700 (PDT) In-Reply-To: Content-Disposition: inline Sender: linux-ext4-owner@vger.kernel.org List-ID: ---------- Forwarded message ---------- From: Manish Katiyar Date: Sun, Sep 14, 2008 at 8:02 PM Subject: [PATCH] resize2fs : Fix potential memory corruption in ext2fs_progress_init() To: linux-ext4@vger.kernel.org, Theodore Tso Cc: mkatiyar@gmail.com 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 --- 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 Any ack/nack on this one ?? I also saw some utilities (debugfs,resizefs) usage don't print the options specified in man pages. Is it intentional ? Are they hidden options for developers ? Thanks - Manish Thanks - Manish