diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-23 09:36:17 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-23 09:36:17 +0000 |
commit | 582c23689f1d8494d42d791c858cbe559d243b04 (patch) | |
tree | db78d1d8b9a1a397cb5728b61a9f9fd4fdd90ace /IntelFrameworkModulePkg/Universal | |
parent | 71b320c703bd88623eebac56df24bb47267a0785 (diff) | |
download | edk2-platforms-582c23689f1d8494d42d791c858cbe559d243b04.tar.xz |
Fix some potential buffer overflow issue.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8629 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal')
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c index dcc1fe2a13..6e5d61c4c4 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c @@ -459,8 +459,8 @@ UpdateConsolePage ( UpdatePageStart (CallbackData);
- ASSERT (ConsoleMenu->MenuNumber <= (sizeof (CallbackData->BmmFakeNvData.ConsoleCheck) / sizeof (CallbackData->BmmFakeNvData.ConsoleCheck[0])));
- for (Index = 0; Index < ConsoleMenu->MenuNumber; Index++) {
+ for (Index = 0; ((Index < ConsoleMenu->MenuNumber) && \
+ (Index < (sizeof (CallbackData->BmmFakeNvData.ConsoleCheck) / sizeof (UINT8)))) ; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (ConsoleMenu, Index);
NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
CheckFlags = 0;
@@ -484,7 +484,8 @@ UpdateConsolePage ( );
}
- for (Index2 = 0; Index2 < TerminalMenu.MenuNumber; Index2++) {
+ for (Index2 = 0; ((Index2 < TerminalMenu.MenuNumber) && \
+ (Index2 < (sizeof (CallbackData->BmmFakeNvData.ConsoleCheck) / sizeof (UINT8)))); Index2++) {
CheckFlags = 0;
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index2);
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
@@ -548,7 +549,8 @@ UpdateOrderPage ( OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (OptionsOpCodeHandle != NULL);
- for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {
+ for (Index = 0; ((Index < OptionMenu->MenuNumber) && \
+ (Index < (sizeof (CallbackData->BmmFakeNvData.OptionOrder) / sizeof (UINT8))))); Index++) {
NewMenuEntry = BOpt_GetMenuEntry (OptionMenu, Index);
HiiCreateOneOfOptionOpCode (
OptionsOpCodeHandle,
|