X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=IntelFrameworkModulePkg%2FUniversal%2FBdsDxe%2FBootMaint%2FUpdatePage.c;h=137a622c90847f62f98271fd0fc7c775b1e84a68;hb=e519983a6cba0f410299ab9e2e970bb369e67bc6;hp=6e5d61c4c4d5a161c84df4cef0c5749aec298045;hpb=582c23689f1d8494d42d791c858cbe559d243b04;p=mirror_edk2.git diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c index 6e5d61c4c4..137a622c90 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c @@ -1,8 +1,8 @@ /** @file Dynamically update the pages. -Copyright (c) 2004 - 2008, Intel Corporation.
-All rights reserved. This program and the accompanying materials +Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -180,7 +180,7 @@ BootThisFile ( Option = (BDS_COMMON_OPTION *) AllocatePool (sizeof (BDS_COMMON_OPTION)); ASSERT (Option != NULL); - Option->Description = FileContext->FileName; + Option->Description = (CHAR16 *) AllocateCopyPool (StrSize (FileContext->FileName), FileContext->FileName); Option->DevicePath = FileContext->DevicePath; Option->LoadOptionsSize = 0; Option->LoadOptions = NULL; @@ -490,6 +490,7 @@ UpdateConsolePage ( NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index2); NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext; + ASSERT (Index < MAX_MENU_NUMBER); if (((NewTerminalContext->IsConIn != 0) && (UpdatePageId == FORM_CON_IN_ID)) || ((NewTerminalContext->IsConOut != 0) && (UpdatePageId == FORM_CON_OUT_ID)) || ((NewTerminalContext->IsStdErr != 0) && (UpdatePageId == FORM_CON_ERR_ID)) @@ -549,8 +550,19 @@ UpdateOrderPage ( OptionsOpCodeHandle = HiiAllocateOpCodeHandle (); ASSERT (OptionsOpCodeHandle != NULL); - for (Index = 0; ((Index < OptionMenu->MenuNumber) && \ - (Index < (sizeof (CallbackData->BmmFakeNvData.OptionOrder) / sizeof (UINT8))))); Index++) { + for ( + Index = 0; + ( + (Index < OptionMenu->MenuNumber) && + (Index < + ( + sizeof (CallbackData->BmmFakeNvData.OptionOrder) / + sizeof (UINT8) + ) + ) + ); + Index++ + ) { NewMenuEntry = BOpt_GetMenuEntry (OptionMenu, Index); HiiCreateOneOfOptionOpCode ( OptionsOpCodeHandle, @@ -742,9 +754,8 @@ UpdateConModePage ( UINTN Index; UINTN Col; UINTN Row; - CHAR16 RowString[50]; CHAR16 ModeString[50]; - UINTN TempStringLen; + CHAR16 *PStr; UINTN MaxMode; UINTN ValidMode; EFI_STRING_ID *ModeToken; @@ -799,12 +810,11 @@ UpdateConModePage ( // // Build mode string Column x Row // - TempStringLen = UnicodeValueToString (ModeString, 0, Col, 0); - ASSERT ((TempStringLen + StrLen (L" x ")) < (sizeof (ModeString) / sizeof (ModeString[0]))); - StrCat (ModeString, L" x "); - TempStringLen = UnicodeValueToString (RowString, 0, Row, 0); - ASSERT ((StrLen (ModeString) + TempStringLen) < (sizeof (ModeString) / sizeof (ModeString[0]))); - StrCat (ModeString, RowString); + UnicodeValueToString (ModeString, 0, Col, 0); + PStr = &ModeString[0]; + StrnCat (PStr, L" x ", StrLen(L" x ") + 1); + PStr = PStr + StrLen (PStr); + UnicodeValueToString (PStr , 0, Row, 0); ModeToken[Index] = HiiSetString (CallbackData->BmmHiiHandle, 0, ModeString, NULL);