]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c
IntelFrameworkModulePkg GenericBdsLib: Use safe string functions
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / GenericBdsLib / Performance.c
index 047d2a7dbcd9c8557ba91cb904b4953ff33c30ba..000542bdceb83397aa97cc046bc61d3522bb4eb4 100644 (file)
@@ -3,7 +3,7 @@
   performance, all the function will only include if the performance\r
   switch is set.\r
 \r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -40,7 +40,7 @@ GetShortPdbFileName (
   UINTN EndIndex;\r
 \r
   if (PdbFileName == NULL) {\r
-    AsciiStrCpy (GaugeString, " ");\r
+    AsciiStrCpyS (GaugeString, PERF_TOKEN_LENGTH, " ");\r
   } else {\r
     StartIndex = 0;\r
     for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++)\r
@@ -91,7 +91,7 @@ GetNameFromHandle (
   CHAR8                       *PdbFileName;\r
   EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;\r
 \r
-  AsciiStrCpy (GaugeString, " ");\r
+  AsciiStrCpyS (GaugeString, PERF_TOKEN_LENGTH, " ");\r
 \r
   //\r
   // Get handle name from image protocol\r
@@ -287,7 +287,7 @@ WriteBootToOsPerformanceData (
 \r
       GetNameFromHandle (Handles[Index], GaugeString);\r
 \r
-      AsciiStrCpy (mPerfData.Token, GaugeString);\r
+      AsciiStrCpyS (mPerfData.Token, PERF_TOKEN_SIZE, GaugeString);\r
       mPerfData.Duration = Duration;\r
 \r
       CopyMem (Ptr, &mPerfData, sizeof (PERF_DATA));\r
@@ -316,7 +316,7 @@ WriteBootToOsPerformanceData (
 \r
       ZeroMem (&mPerfData, sizeof (PERF_DATA));\r
 \r
-      AsciiStrnCpy (mPerfData.Token, Token, PERF_TOKEN_LENGTH);\r
+      AsciiStrnCpyS (mPerfData.Token, PERF_TOKEN_SIZE, Token, PERF_TOKEN_LENGTH);\r
       if (StartTicker == 1) {\r
         StartTicker = StartValue;\r
       }\r