From be5903ad1e244cbb0930161fb361ed0b699c4cb8 Mon Sep 17 00:00:00 2001 From: Zhichao Gao Date: Mon, 10 Jun 2019 09:54:52 +0800 Subject: [PATCH] MdeMoudlePkg/CapsulePei: No need to remain space for null-terminate REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1853 UnicodeValueToStringS would remain two bytes for the first parameter to set the null- terminate. So remove this change in Mu. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming Gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Cc: Leif Lindholm Signed-off-by: Zhichao gao Reviewed-by: Leif Lindholm Reviewed-by: Hao A Wu --- MdeModulePkg/Universal/CapsulePei/UefiCapsule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c index 3ac95b7be6..8d4ae69bb2 100644 --- a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c +++ b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c @@ -922,7 +922,7 @@ GetScatterGatherHeadEntries ( if (Index != 0) { UnicodeValueToStringS ( TempVarName, - (sizeof (CapsuleVarName) - ((StrLen (CapsuleVarName) + 1) * sizeof (CHAR16))), + (sizeof (CapsuleVarName) - ((UINTN)TempVarName - (UINTN)CapsuleVarName)), 0, Index, 0 -- 2.39.2