Revision: 17777 http://sourceforge.net/p/edk2/code/17777 Author: shenshushi Date: 2015-07-01 08:03:50 +0000 (Wed, 01 Jul 2015) Log Message: ----------- MdeModulePkg/Application/MemoryProfileInfo: 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/Application/MemoryProfileInfo/MemoryProfileInfo.c Modified: trunk/edk2/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c =================================================================== --- trunk/edk2/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c 2015-07-01 06:48:57 UTC (rev 17776) +++ trunk/edk2/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c 2015-07-01 08:03:50 UTC (rev 17777) @@ -121,10 +121,10 @@ UINTN StartIndex; UINTN EndIndex; - ZeroMem (UnicodeBuffer, PROFILE_NAME_STRING_LENGTH * sizeof (CHAR16)); + ZeroMem (UnicodeBuffer, (PROFILE_NAME_STRING_LENGTH + 1) * sizeof (CHAR16)); if (PdbFileName == NULL) { - StrnCpy (UnicodeBuffer, L" ", 1); + StrnCpyS (UnicodeBuffer, PROFILE_NAME_STRING_LENGTH + 1, L" ", 1); } else { StartIndex = 0; for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++); @@ -201,7 +201,7 @@ // // Method 2: Get the name string from FFS UI section // - StrnCpy (mNameString, NameString, PROFILE_NAME_STRING_LENGTH); + StrCpyS (mNameString, PROFILE_NAME_STRING_LENGTH + 1, NameString); mNameString[PROFILE_NAME_STRING_LENGTH] = 0; FreePool (NameString); return; ------------------------------------------------------------------------------ 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