Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17737
6f19259b-4bc3-4df7-8a09-
765794883524
/** @file\r
The platform boot manager reference implementation\r
\r
/** @file\r
The platform boot manager reference implementation\r
\r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
EFI_STRING_ID Token;\r
EFI_INPUT_KEY Key;\r
CHAR16 *HelpString;\r
EFI_STRING_ID Token;\r
EFI_INPUT_KEY Key;\r
CHAR16 *HelpString;\r
EFI_STRING_ID HelpToken;\r
UINT16 *TempStr;\r
EFI_HII_HANDLE HiiHandle;\r
EFI_BROWSER_ACTION_REQUEST ActionRequest;\r
EFI_STRING_ID HelpToken;\r
UINT16 *TempStr;\r
EFI_HII_HANDLE HiiHandle;\r
EFI_BROWSER_ACTION_REQUEST ActionRequest;\r
VOID *StartOpCodeHandle;\r
VOID *EndOpCodeHandle;\r
EFI_IFR_GUID_LABEL *StartLabel;\r
VOID *StartOpCodeHandle;\r
VOID *EndOpCodeHandle;\r
EFI_IFR_GUID_LABEL *StartLabel;\r
Token = HiiSetString (HiiHandle, 0, Option->Description, NULL);\r
\r
TempStr = DevicePathToStr (Option->DevicePath);\r
Token = HiiSetString (HiiHandle, 0, Option->Description, NULL);\r
\r
TempStr = DevicePathToStr (Option->DevicePath);\r
- TempSize = StrSize (TempStr);\r
- HelpString = AllocateZeroPool (TempSize + StrSize (L"Device Path : "));\r
+ HelpSize = StrSize (TempStr) + StrSize (L"Device Path : ");\r
+ HelpString = AllocateCopyPool (HelpSize, L"Device Path : ");\r
ASSERT (HelpString != NULL);\r
ASSERT (HelpString != NULL);\r
- StrCat (HelpString, L"Device Path : ");\r
- StrCat (HelpString, TempStr);\r
+ StrCatS (HelpString, HelpSize / sizeof (CHAR16), TempStr);\r
\r
HelpToken = HiiSetString (HiiHandle, 0, HelpString, NULL);\r
\r
\r
HelpToken = HiiSetString (HiiHandle, 0, HelpString, NULL);\r
\r