From 0ec2bfc8578af1bfbd33445dddc78fb4867d4adf Mon Sep 17 00:00:00 2001 From: Qiu Shumin Date: Tue, 7 Jul 2015 03:01:07 +0000 Subject: MdeModulePkg: Use StrnCpyS instead of StrCpyS to indicate the copy length from the source. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin Reviewed-by: Hao Wu Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17841 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 4 ++-- MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index 7ebdb29fea..0eb8e579d7 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -191,10 +191,10 @@ StartGaugeEx ( GaugeEntryExArray[Index].Handle = (EFI_PHYSICAL_ADDRESS) (UINTN) Handle; if (Token != NULL) { - AsciiStrCpyS (GaugeEntryExArray[Index].Token, DXE_PERFORMANCE_STRING_SIZE, Token); + AsciiStrnCpyS (GaugeEntryExArray[Index].Token, DXE_PERFORMANCE_STRING_SIZE, Token, DXE_PERFORMANCE_STRING_LENGTH); } if (Module != NULL) { - AsciiStrCpyS (GaugeEntryExArray[Index].Module, DXE_PERFORMANCE_STRING_SIZE, Module); + AsciiStrnCpyS (GaugeEntryExArray[Index].Module, DXE_PERFORMANCE_STRING_SIZE, Module, DXE_PERFORMANCE_STRING_LENGTH); } GaugeEntryExArray[Index].EndTimeStamp = 0; diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c b/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c index dd937a7396..7b13ec663c 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c @@ -320,7 +320,7 @@ BmWriteBootToOsPerformanceData ( ZeroMem (&mBmPerfData, sizeof (PERF_DATA)); - AsciiStrCpyS (mBmPerfData.Token, PERF_TOKEN_SIZE, Token); + AsciiStrnCpyS (mBmPerfData.Token, PERF_TOKEN_SIZE, Token, PERF_TOKEN_LENGTH); if (StartTicker == 1) { StartTicker = StartValue; } -- cgit v1.2.3