summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-05-10 02:17:31 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-05-10 02:17:31 +0000
commite35eb8af7b27e0c035f668787d366d05c608ac81 (patch)
tree8502044fef260195a9f2cc479860c39aeae57911 /MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
parent61f0f4375b35dd9b3ab6f1e1803385b57a22c7fb (diff)
downloadedk2-platforms-e35eb8af7b27e0c035f668787d366d05c608ac81.tar.xz
1. Use the max string size to compare password string.
2. Check whether the local variable is valid as the array index. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10473 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c b/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
index 2541743f4f..2905006856 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
@@ -464,16 +464,20 @@ TheKey2:
}
if (MenuOption->Sequence == 0) {
+ ASSERT (EraseLen >= 2);
FormattedNumber[EraseLen - 2] = DATE_SEPARATOR;
} else if (MenuOption->Sequence == 1) {
+ ASSERT (EraseLen >= 1);
FormattedNumber[EraseLen - 1] = DATE_SEPARATOR;
}
} else if (Question->Operand == EFI_IFR_TIME_OP) {
UnicodeSPrint (FormattedNumber, 21 * sizeof (CHAR16), L"%02d", (UINT8) EditValue);
if (MenuOption->Sequence == 0) {
+ ASSERT (EraseLen >= 2);
FormattedNumber[EraseLen - 2] = TIME_SEPARATOR;
} else if (MenuOption->Sequence == 1) {
+ ASSERT (EraseLen >= 1);
FormattedNumber[EraseLen - 1] = TIME_SEPARATOR;
}
} else {