EFI_STATUS Status;\r
UINTN Index;\r
UINTN DevicePathHandleCount;\r
+ UINTN NewStrSize;\r
CHAR16 *NewString;\r
EFI_STRING_ID NewStringToken;\r
CHAR16 *ControllerName;\r
// Export the driver name string and create item in set options page\r
//\r
Len = StrSize (ControllerName);\r
- NewString = AllocateZeroPool (Len + StrSize (L"--"));\r
+ NewStrSize = Len + StrSize (L"--");\r
+ NewString = AllocateZeroPool (NewStrSize);\r
ASSERT (NewString != NULL);\r
if (EFI_ERROR (CheckMapping (ControllerDevicePath,NULL, &mMappingDataBase, NULL, NULL))) {\r
- StrCat (NewString, L"--");\r
+ StrCatS (NewString, NewStrSize/sizeof(CHAR16), L"--");\r
} else {\r
- StrCat (NewString, L"**");\r
+ StrCatS (NewString, NewStrSize/sizeof(CHAR16), L"**");\r
}\r
- StrCat (NewString, ControllerName);\r
+ StrCatS (NewString, NewStrSize/sizeof(CHAR16), ControllerName);\r
\r
NewStringToken = HiiSetString (Private->RegisteredHandle, mControllerToken[Index], NewString, NULL);\r
ASSERT (NewStringToken != 0);\r
{\r
EFI_STATUS Status;\r
UINTN Index;\r
+ UINTN NewStrSize;\r
CHAR16 *NewString;\r
EFI_STRING_ID NewStringToken;\r
EFI_STRING_ID NewStringHelpToken;\r
//\r
// First create the driver image name\r
//\r
- NewString = AllocateZeroPool (StrSize (DriverName));\r
+ NewStrSize = StrSize (DriverName);\r
+ NewString = AllocateZeroPool (NewStrSize);\r
ASSERT (NewString != NULL); \r
if (EFI_ERROR (CheckMapping (mControllerDevicePathProtocol[mSelectedCtrIndex], LoadedImageDevicePath, &mMappingDataBase, NULL, NULL))) {\r
mDriSelection[Index] = FALSE;\r
mDriSelection[Index] = TRUE;\r
mLastSavedDriverImageNum++;\r
}\r
- StrCat (NewString, DriverName);\r
+ StrCatS (NewString, NewStrSize/sizeof(CHAR16), DriverName);\r
NewStringToken = HiiSetString (Private->RegisteredHandle, mDriverImageToken[Index], NewString, NULL);\r
ASSERT (NewStringToken != 0);\r
mDriverImageToken[Index] = NewStringToken;\r
//\r
DriverName = DevicePathToStr (LoadedImageDevicePath);\r
\r
- NewString = AllocateZeroPool (StrSize (DriverName));\r
+ NewStrSize = StrSize (DriverName);\r
+ NewString = AllocateZeroPool (NewStrSize);\r
ASSERT (NewString != NULL); \r
- StrCat (NewString, DriverName);\r
+ StrCatS (NewString, NewStrSize/sizeof(CHAR16), DriverName);\r
NewStringHelpToken = HiiSetString (Private->RegisteredHandle, DriverImageFilePathToken[Index], NewString, NULL);\r
ASSERT (NewStringHelpToken != 0);\r
DriverImageFilePathToken[Index] = NewStringHelpToken;\r