]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Library/DxeCorePerformanceLib: Use safe string functions to refine code.
authorQiu Shumin <shumin.qiu@intel.com>
Wed, 1 Jul 2015 08:05:00 +0000 (08:05 +0000)
committershenshushi <shenshushi@Edk2>
Wed, 1 Jul 2015 08:05:00 +0000 (08:05 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17778 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c

index 90053e76762d154368b253cf955bd11069769f5d..7ebdb29fea4ff2857195b575a5482e4e2050b6ba 100644 (file)
@@ -10,7 +10,7 @@
   This library is mainly used by DxeCore to start performance logging to ensure that\r
   Performance Protocol is installed at the very beginning of DXE phase.\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -191,10 +191,10 @@ StartGaugeEx (
   GaugeEntryExArray[Index].Handle = (EFI_PHYSICAL_ADDRESS) (UINTN) Handle;\r
 \r
   if (Token != NULL) {\r
-    AsciiStrnCpy (GaugeEntryExArray[Index].Token, Token, DXE_PERFORMANCE_STRING_LENGTH);\r
+    AsciiStrCpyS (GaugeEntryExArray[Index].Token, DXE_PERFORMANCE_STRING_SIZE, Token);\r
   }\r
   if (Module != NULL) {\r
-    AsciiStrnCpy (GaugeEntryExArray[Index].Module, Module, DXE_PERFORMANCE_STRING_LENGTH);\r
+    AsciiStrCpyS (GaugeEntryExArray[Index].Module, DXE_PERFORMANCE_STRING_SIZE, Module);\r
   }\r
 \r
   GaugeEntryExArray[Index].EndTimeStamp = 0;\r
@@ -463,8 +463,8 @@ InternalGetPeiPerformance (
     NumberOfEntries = LogHob->NumberOfEntries;\r
     for (Index = 0; Index < NumberOfEntries; Index++) {\r
       GaugeEntryExArray[Index].Handle         = LogEntryArray[Index].Handle;\r
-      AsciiStrnCpy (GaugeEntryExArray[Index].Token,  LogEntryArray[Index].Token,  DXE_PERFORMANCE_STRING_LENGTH);\r
-      AsciiStrnCpy (GaugeEntryExArray[Index].Module, LogEntryArray[Index].Module, DXE_PERFORMANCE_STRING_LENGTH);\r
+      AsciiStrCpyS (GaugeEntryExArray[Index].Token,  DXE_PERFORMANCE_STRING_SIZE, LogEntryArray[Index].Token);\r
+      AsciiStrCpyS (GaugeEntryExArray[Index].Module, DXE_PERFORMANCE_STRING_SIZE, LogEntryArray[Index].Module);\r
       GaugeEntryExArray[Index].StartTimeStamp = LogEntryArray[Index].StartTimeStamp;\r
       GaugeEntryExArray[Index].EndTimeStamp   = LogEntryArray[Index].EndTimeStamp;\r
       GaugeEntryExArray[Index].Identifier     = 0;\r