Discussion:
[edk2] [PATCH 04/13] MdeModulePkg/Library/PeiPerformanceLib: Use safe string functions to refine code.
Qiu Shumin
2015-06-25 07:46:48 UTC
Permalink
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <***@intel.com>
---
MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
index 60451ee..4eb47d1 100644
--- a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
+++ b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
@@ -6,7 +6,7 @@
performance data to the GUIDed HOB. Due to the limitation of temporary RAM, the maximum
number of performance logging entry is specified by PcdMaxPeiPerformanceLogEntries.

-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
@@ -190,10 +190,10 @@ StartPerformanceMeasurementEx (
LogEntryArray[Index].Handle = (EFI_PHYSICAL_ADDRESS) (UINTN) Handle;

if (Token != NULL) {
- AsciiStrnCpy (LogEntryArray[Index].Token, Token, PEI_PERFORMANCE_STRING_LENGTH);
+ AsciiStrCpyS (LogEntryArray[Index].Token, PEI_PERFORMANCE_STRING_SIZE, Token);
}
if (Module != NULL) {
- AsciiStrnCpy (LogEntryArray[Index].Module, Module, PEI_PERFORMANCE_STRING_LENGTH);
+ AsciiStrCpyS (LogEntryArray[Index].Module, PEI_PERFORMANCE_STRING_SIZE, Module);
}

LogEntryArray[Index].EndTimeStamp = 0;
--
1.9.5.msysgit.1
Zeng, Star
2015-06-25 09:30:04 UTC
Permalink
Reviewed-by: Star Zeng <***@intel.com>

-----Original Message-----
From: Qiu, Shumin
Sent: Thursday, June 25, 2015 3:47 PM
To: edk2-***@lists.sourceforge.net
Cc: Zeng, Star; Fan, Jeff; Gao, Liming; Ni, Ruiyu; Tian, Feng
Subject: [PATCH 04/13] MdeModulePkg/Library/PeiPerformanceLib: Use safe string functions to refine code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <***@intel.com>
---
MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
index 60451ee..4eb47d1 100644
--- a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
+++ b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
@@ -6,7 +6,7 @@
performance data to the GUIDed HOB. Due to the limitation of temporary RAM, the maximum
number of performance logging entry is specified by PcdMaxPeiPerformanceLogEntries.

-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 @@ -190,10 +190,10 @@ StartPerformanceMeasurementEx (
LogEntryArray[Index].Handle = (EFI_PHYSICAL_ADDRESS) (UINTN) Handle;

if (Token != NULL) {
- AsciiStrnCpy (LogEntryArray[Index].Token, Token, PEI_PERFORMANCE_STRING_LENGTH);
+ AsciiStrCpyS (LogEntryArray[Index].Token,
+ PEI_PERFORMANCE_STRING_SIZE, Token);
}
if (Module != NULL) {
- AsciiStrnCpy (LogEntryArray[Index].Module, Module, PEI_PERFORMANCE_STRING_LENGTH);
+ AsciiStrCpyS (LogEntryArray[Index].Module,
+ PEI_PERFORMANCE_STRING_SIZE, Module);
}

LogEntryArray[Index].EndTimeStamp = 0;
--
1.9.5.msysgit.1

Loading...