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

diff --git a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c
index da2adf0..1a991a3 100644
--- a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c
+++ b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c
@@ -203,10 +203,10 @@ StartGaugeEx (
GaugeEntryExArray[Index].Handle = (EFI_PHYSICAL_ADDRESS) (UINTN) Handle;

if (Token != NULL) {
- AsciiStrnCpy (GaugeEntryExArray[Index].Token, Token, SMM_PERFORMANCE_STRING_LENGTH);
+ AsciiStrCpyS (GaugeEntryExArray[Index].Token, DXE_PERFORMANCE_STRING_SIZE, Token);
}
if (Module != NULL) {
- AsciiStrnCpy (GaugeEntryExArray[Index].Module, Module, SMM_PERFORMANCE_STRING_LENGTH);
+ AsciiStrCpyS (GaugeEntryExArray[Index].Module, DXE_PERFORMANCE_STRING_SIZE, Module);
}

GaugeEntryExArray[Index].EndTimeStamp = 0;
--
1.9.5.msysgit.1
Zeng, Star
2015-06-25 09:20:08 UTC
Permalink
Please use SMM_PERFORMANCE_STRING_SIZE, but not DXE_PERFORMANCE_STRING_SIZE.

Thanks,
Star
-----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 05/13] MdeModulePkg/Library/SmmCorePerformanceLib: Use safe string functions to refine code.

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

diff --git a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c
index da2adf0..1a991a3 100644
--- a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c
+++ b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c
@@ -203,10 +203,10 @@ StartGaugeEx (
GaugeEntryExArray[Index].Handle = (EFI_PHYSICAL_ADDRESS) (UINTN) Handle;

if (Token != NULL) {
- AsciiStrnCpy (GaugeEntryExArray[Index].Token, Token, SMM_PERFORMANCE_STRING_LENGTH);
+ AsciiStrCpyS (GaugeEntryExArray[Index].Token, DXE_PERFORMANCE_STRING_SIZE, Token);
}
if (Module != NULL) {
- AsciiStrnCpy (GaugeEntryExArray[Index].Module, Module, SMM_PERFORMANCE_STRING_LENGTH);
+ AsciiStrCpyS (GaugeEntryExArray[Index].Module, DXE_PERFORMANCE_STRING_SIZE, Module);
}

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