}\r
\r
if (HiiString != NULL) {\r
- NewLoadContext->Description = AllocateZeroPool(StrSize((UINT16*)LoadOptionPtr) + StrSize(HiiString));\r
+ NewLoadContext->Description = AllocateZeroPool(StringSize + StrSize(HiiString));\r
StrCpy (NewLoadContext->Description, HiiString);\r
if (StrnCmp ((UINT16*)LoadOptionPtr, L"0", 1) != 0) {\r
StrCat (NewLoadContext->Description, L" ");\r
CHAR16 *HiiString;\r
CHAR16 *BootStringNumber;\r
UINTN DevicePathType;\r
+ UINTN BufferSize;\r
\r
gOption = NULL;\r
InitializeListHead (&BdsBootOptionList);\r
//\r
if (HiiString != NULL) {\r
BootStringNumber = Option->Description;\r
- Option->Description = AllocateZeroPool(StrSize(BootStringNumber) + StrSize(HiiString));\r
+ BufferSize = StrSize(BootStringNumber);\r
+ BufferSize += StrSize(HiiString);\r
+ Option->Description = AllocateZeroPool(BufferSize);\r
StrCpy (Option->Description, HiiString);\r
if (StrnCmp (BootStringNumber, L"0", 1) != 0) {\r
StrCat (Option->Description, L" ");\r