From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E614781F42 for ; Wed, 16 Nov 2016 18:24:47 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP; 16 Nov 2016 18:24:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,651,1473145200"; d="scan'208";a="32318950" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by fmsmga006.fm.intel.com with ESMTP; 16 Nov 2016 18:24:32 -0800 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Liming Gao , Eric Dong , Jiewen Yao Date: Thu, 17 Nov 2016 10:24:06 +0800 Message-Id: <1479349447-46344-4-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1479349447-46344-1-git-send-email-dandan.bi@intel.com> References: <1479349447-46344-1-git-send-email-dandan.bi@intel.com> Subject: [patch 3/4] MdeModulePkg: Clear the buffer after using it X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 02:24:48 -0000 Cc: Liming Gao Cc: Eric Dong Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi --- MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c | 3 ++- MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c index 95bd5f0..557e8ec 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c @@ -905,11 +905,12 @@ PasswordProcess ( CreateDialog (&Key, gEmptyString, gConfirmError, gPressEnter, gEmptyString, NULL); } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN); Status = EFI_INVALID_PARAMETER; } - + ZeroMem (TempString, (Maximum + 1) * sizeof (CHAR16)); + ZeroMem (StringPtr, (Maximum + 1) * sizeof (CHAR16)); FreePool (TempString); FreePool (StringPtr); return Status; } diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index 0c5d1b4..aa0bd22 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -1614,10 +1614,11 @@ ProcessUserInput ( } DeleteString(Statement->HiiValue.Value.string, gCurrentSelection->FormSet->HiiHandle); Statement->HiiValue.Value.string = UserInput->InputValue.Value.string; CopyMem (Statement->BufferValue, UserInput->InputValue.Buffer, (UINTN) UserInput->InputValue.BufferLen); + ZeroMem (UserInput->InputValue.Buffer, (UINTN) UserInput->InputValue.BufferLen); FreePool (UserInput->InputValue.Buffer); // // Two password match, send it to Configuration Driver // if ((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != 0) { -- 1.9.5.msysgit.1