summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library/DxeCorePerformanceLib
diff options
context:
space:
mode:
authorQiu Shumin <shumin.qiu@intel.com>2015-07-01 08:05:00 +0000
committershenshushi <shenshushi@Edk2>2015-07-01 08:05:00 +0000
commit96f983fabce784e307a70c7361db2c02f03afab2 (patch)
tree95e842bffed2285b08b4c6ee337f1a2640e6fae5 /MdeModulePkg/Library/DxeCorePerformanceLib
parentd89deb3d7ec0f41af85abe5e0bd7403ecf2809fa (diff)
downloadedk2-96f983fabce784e307a70c7361db2c02f03afab2.tar.gz
edk2-96f983fabce784e307a70c7361db2c02f03afab2.tar.bz2
edk2-96f983fabce784e307a70c7361db2c02f03afab2.zip
MdeModulePkg/Library/DxeCorePerformanceLib: Use safe string functions to refine code.
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
Diffstat (limited to 'MdeModulePkg/Library/DxeCorePerformanceLib')
-rw-r--r--MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
index 90053e7676..7ebdb29fea 100644
--- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
+++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
@@ -10,7 +10,7 @@
This library is mainly used by DxeCore to start performance logging to ensure that
Performance Protocol is installed at the very beginning of DXE phase.
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -191,10 +191,10 @@ StartGaugeEx (
GaugeEntryExArray[Index].Handle = (EFI_PHYSICAL_ADDRESS) (UINTN) Handle;
if (Token != NULL) {
- AsciiStrnCpy (GaugeEntryExArray[Index].Token, Token, DXE_PERFORMANCE_STRING_LENGTH);
+ AsciiStrCpyS (GaugeEntryExArray[Index].Token, DXE_PERFORMANCE_STRING_SIZE, Token);
}
if (Module != NULL) {
- AsciiStrnCpy (GaugeEntryExArray[Index].Module, Module, DXE_PERFORMANCE_STRING_LENGTH);
+ AsciiStrCpyS (GaugeEntryExArray[Index].Module, DXE_PERFORMANCE_STRING_SIZE, Module);
}
GaugeEntryExArray[Index].EndTimeStamp = 0;
@@ -463,8 +463,8 @@ InternalGetPeiPerformance (
NumberOfEntries = LogHob->NumberOfEntries;
for (Index = 0; Index < NumberOfEntries; Index++) {
GaugeEntryExArray[Index].Handle = LogEntryArray[Index].Handle;
- AsciiStrnCpy (GaugeEntryExArray[Index].Token, LogEntryArray[Index].Token, DXE_PERFORMANCE_STRING_LENGTH);
- AsciiStrnCpy (GaugeEntryExArray[Index].Module, LogEntryArray[Index].Module, DXE_PERFORMANCE_STRING_LENGTH);
+ AsciiStrCpyS (GaugeEntryExArray[Index].Token, DXE_PERFORMANCE_STRING_SIZE, LogEntryArray[Index].Token);
+ AsciiStrCpyS (GaugeEntryExArray[Index].Module, DXE_PERFORMANCE_STRING_SIZE, LogEntryArray[Index].Module);
GaugeEntryExArray[Index].StartTimeStamp = LogEntryArray[Index].StartTimeStamp;
GaugeEntryExArray[Index].EndTimeStamp = LogEntryArray[Index].EndTimeStamp;
GaugeEntryExArray[Index].Identifier = 0;