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
This commit is contained in:
lgao4
2010-05-10 02:17:31 +00:00
parent 61f0f4375b
commit e35eb8af7b
3 changed files with 8 additions and 4 deletions

View File

@@ -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 {