Revision: 17778 http://sourceforge.net/p/edk2/code/17778 Author: shenshushi Date: 2015-07-01 08:05:00 +0000 (Wed, 01 Jul 2015) Log Message: ----------- MdeModulePkg/Library/DxeCorePerformanceLib: Use safe string functions to refine code.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin....@intel.com> Reviewed-by: Star Zeng <star.z...@intel.com> Modified Paths: -------------- trunk/edk2/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c Modified: trunk/edk2/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c =================================================================== --- trunk/edk2/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c 2015-07-01 08:03:50 UTC (rev 17777) +++ trunk/edk2/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c 2015-07-01 08:05:00 UTC (rev 17778) @@ -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 @@ 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 @@ 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; ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ edk2-commits mailing list edk2-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-commits