summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2016-05-27 16:00:28 +0800
committerStar Zeng <star.zeng@intel.com>2016-11-25 10:50:27 +0800
commita275df8f9a4d2a43772ea5d1765b541a1191ad3f (patch)
tree7a8c123146799bde8411c124c47274b19c191be4 /MdeModulePkg
parent9e2462b8a28b09738a3177e1694867ca114cc185 (diff)
downloadedk2-a275df8f9a4d2a43772ea5d1765b541a1191ad3f.tar.gz
edk2-a275df8f9a4d2a43772ea5d1765b541a1191ad3f.tar.bz2
edk2-a275df8f9a4d2a43772ea5d1765b541a1191ad3f.zip
MdeModulePkg: Clear the buffer after using it
Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c3
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c1
2 files changed, 3 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
index 95bd5f0919..557e8ecd94 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
@@ -907,7 +907,8 @@ PasswordProcess (
Status = EFI_INVALID_PARAMETER;
}
-
+ ZeroMem (TempString, (Maximum + 1) * sizeof (CHAR16));
+ ZeroMem (StringPtr, (Maximum + 1) * sizeof (CHAR16));
FreePool (TempString);
FreePool (StringPtr);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 0c5d1b4018..aa0bd229ce 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -1616,6 +1616,7 @@ 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