UINT16 Length0;\r
UINT16 Length1;\r
UINT8 *TmpBuf;\r
+ UINTN MaxLen;\r
\r
//\r
// String[0] - The second string\r
\r
if (Value[0].Type == EFI_IFR_TYPE_STRING) {\r
Size = StrSize (String[0]);\r
- StringPtr= AllocatePool (StrSize (String[1]) + Size);\r
+ MaxLen = (StrSize (String[1]) + Size) / sizeof (CHAR16);\r
+ StringPtr= AllocatePool (MaxLen * sizeof (CHAR16));\r
ASSERT (StringPtr != NULL);\r
- StrCpy (StringPtr, String[1]);\r
- StrCat (StringPtr, String[0]);\r
+ StrCpyS (StringPtr, MaxLen, String[1]);\r
+ StrCatS (StringPtr, MaxLen, String[0]);\r
\r
Result->Type = EFI_IFR_TYPE_STRING;\r
Result->Value.string = NewString (StringPtr, FormSet->HiiHandle);\r