]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg BaseUefiDecompressLib: Fix UEFI Decompression logic issue
authorLiming Gao <liming.gao@intel.com>
Thu, 8 Nov 2018 23:58:15 +0000 (07:58 +0800)
committerLiming Gao <liming.gao@intel.com>
Sun, 11 Nov 2018 03:48:34 +0000 (11:48 +0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=1317

This is a regression issue caused by 2ec7953d49677142c5f7552e9e3d96fb406ba0c4.
In Decode() function, once mOutBuf is fully filled, Decode() should return.
Current logic misses the checker of mOutBuf after while() loop.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c

index 9fc637e0582e163eef0c87137a19676cf7915183..c1e8c5581a04b5db2a3a537cb533e7d542462a68 100644 (file)
@@ -641,6 +641,12 @@ Decode (
 \r
         BytesRemain--;\r
       }\r
+      //\r
+      // Once mOutBuf is fully filled, directly return\r
+      //\r
+      if (Sd->mOutBuf >= Sd->mOrigSize) {\r
+        goto Done;\r
+      }\r
     }\r
   }\r
 \r