]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeMoudlePkg/CapsulePei: No need to remain space for null-terminate
authorZhichao Gao <zhichao.gao@intel.com>
Mon, 10 Jun 2019 01:54:52 +0000 (09:54 +0800)
committerHao A Wu <hao.a.wu@intel.com>
Mon, 24 Jun 2019 01:18:32 +0000 (09:18 +0800)
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 <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Zhichao gao <zhichao.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Universal/CapsulePei/UefiCapsule.c

index 3ac95b7be67c994c1812dec4aa1f11a2a41ceb2e..8d4ae69bb2e9f14c0257577c2518d855bf4c8aea 100644 (file)
@@ -922,7 +922,7 @@ GetScatterGatherHeadEntries (
     if (Index != 0) {\r
       UnicodeValueToStringS (\r
         TempVarName,\r
     if (Index != 0) {\r
       UnicodeValueToStringS (\r
         TempVarName,\r
-        (sizeof (CapsuleVarName) - ((StrLen (CapsuleVarName) + 1) * sizeof (CHAR16))),\r
+        (sizeof (CapsuleVarName) - ((UINTN)TempVarName - (UINTN)CapsuleVarName)),\r
         0,\r
         Index,\r
         0\r
         0,\r
         Index,\r
         0\r