From: Zhichao Gao Date: Mon, 10 Jun 2019 01:54:52 +0000 (+0800) Subject: MdeMoudlePkg/CapsulePei: No need to remain space for null-terminate X-Git-Tag: edk2-stable201908~364 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=be5903ad1e244cbb0930161fb361ed0b699c4cb8 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 --- 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