summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Application/UiApp/BootMngr/BootManager.c')
-rw-r--r--MdeModulePkg/Application/UiApp/BootMngr/BootManager.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c b/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
index fa35ad4bf2..986413c19b 100644
--- a/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
+++ b/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
@@ -236,6 +236,7 @@ EnumerateBootOptions (
BOOLEAN IsLegacyOption;
BOOLEAN NeedEndOp;
UINT16 KeyInput;
+ UINTN DestMax;
DeviceType = (UINT16) -1;
@@ -325,10 +326,11 @@ EnumerateBootOptions (
TempStr = UiDevicePathToStr (BootOption[Index].FilePath);
TempSize = StrSize (TempStr);
+ DestMax = (TempSize + StrSize (L"Device Path : ")) / sizeof(CHAR16);
HelpString = AllocateZeroPool (TempSize + StrSize (L"Device Path : "));
ASSERT (HelpString != NULL);
- StrCat (HelpString, L"Device Path : ");
- StrCat (HelpString, TempStr);
+ StrCatS (HelpString, DestMax, L"Device Path : ");
+ StrCatS (HelpString, DestMax, TempStr);
HelpToken = HiiSetString (HiiHandle, 0, HelpString, NULL);