BOOLEAN CumulativeMode;\r
CONST CHAR16 *CustomCumulativeToken;\r
PERF_CUM_DATA *CustomCumulativeData;\r
+ UINTN NameSize;\r
EFI_HII_PACKAGE_LIST_HEADER *PackageList;\r
\r
EFI_STRING StringDpOptionQh;\r
CustomCumulativeData->MaxDur = 0;\r
CustomCumulativeData->Count = 0;\r
CustomCumulativeData->Duration = 0;\r
- CustomCumulativeData->Name = AllocateZeroPool (StrLen (CustomCumulativeToken) + 1);\r
- UnicodeStrToAsciiStr (CustomCumulativeToken, CustomCumulativeData->Name);\r
+ NameSize = StrLen (CustomCumulativeToken) + 1;\r
+ CustomCumulativeData->Name = AllocateZeroPool (NameSize);\r
+ UnicodeStrToAsciiStrS (CustomCumulativeToken, CustomCumulativeData->Name, NameSize);\r
}\r
\r
/****************************************************************************\r
/** @file\r
Trace reporting for the Dp utility.\r
\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
++Count; // Count the number of records printed\r
\r
// If Handle is non-zero, see if we can determine a name for the driver\r
- AsciiStrToUnicodeStr (Measurement.Module, mGaugeString); // Use Module by default\r
- AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);\r
+ AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0])); // Use Module by default\r
+ AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0]));\r
if (Measurement.Handle != NULL) {\r
// See if the Handle is in the HandleBuffer\r
for (TIndex = 0; TIndex < HandleCount; TIndex++) {\r
continue;\r
}\r
mGaugeString[0] = 0; // Empty driver name by default\r
- AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);\r
+ AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0]));\r
// See if the Handle is in the HandleBuffer\r
for (Index = 0; Index < HandleCount; Index++) {\r
if (Measurement.Handle == HandleBuffer[Index]) {\r
&Measurement.EndTimeStamp,\r
&Measurement.Identifier)) != 0)\r
{\r
- AsciiStrToUnicodeStr (Measurement.Module, mGaugeString);\r
- AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);\r
+ AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0]));\r
+ AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0]));\r
mGaugeString[25] = 0;\r
mUnicodeToken[31] = 0;\r
if ( ! ( IsPhase( &Measurement) ||\r