This commit will resolve the issue brought by r17745. StrCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, StringPtr);
The above using of StrCpyS will cause ASSERT if StringPtr is longer than mGaugeString. Therefore, StrnCpyS is used here to resolve the issue. Similar scenario is for: StrCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, NameString); (twice) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a...@intel.com> Reviewed-by: Star Zeng <star.z...@intel.com> --- PerformancePkg/Dp_App/DpUtilities.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/PerformancePkg/Dp_App/DpUtilities.c b/PerformancePkg/Dp_App/DpUtilities.c index 38d7aa3..ec5a524 100644 --- a/PerformancePkg/Dp_App/DpUtilities.c +++ b/PerformancePkg/Dp_App/DpUtilities.c @@ -290,10 +290,11 @@ GetNameFromHandle ( ); SafeFreePool (BestLanguage); if (!EFI_ERROR (Status)) { - StrCpyS ( + StrnCpyS ( mGaugeString, DP_GAUGE_STRING_LENGTH + 1, - StringPtr + StringPtr, + DP_GAUGE_STRING_LENGTH ); return; } @@ -337,10 +338,11 @@ GetNameFromHandle ( // // Method 3. Get the name string from FFS UI section // - StrCpyS ( + StrnCpyS ( mGaugeString, DP_GAUGE_STRING_LENGTH + 1, - NameString + NameString, + DP_GAUGE_STRING_LENGTH ); FreePool (NameString); } else { @@ -356,10 +358,11 @@ GetNameFromHandle ( // NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE); if (NameString != NULL) { - StrCpyS ( + StrnCpyS ( mGaugeString, DP_GAUGE_STRING_LENGTH + 1, - NameString + NameString, + DP_GAUGE_STRING_LENGTH ); FreePool (NameString); return; -- 1.9.5.msysgit.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-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel