summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2018-11-09 07:58:16 +0800
committerLiming Gao <liming.gao@intel.com>2018-11-14 08:41:37 +0800
commit79daf8c766a38d79bf6ed5381680ad83cf770e08 (patch)
tree406a360dbbab76e9fab0c3271bb1c0ed5e8ddb7a
parentfa01ffdfdf8fef63ea5852547d13639f913659c5 (diff)
downloadedk2-79daf8c766a38d79bf6ed5381680ad83cf770e08.tar.gz
edk2-79daf8c766a38d79bf6ed5381680ad83cf770e08.tar.bz2
edk2-79daf8c766a38d79bf6ed5381680ad83cf770e08.zip
IntelFrameworkModulePkg: Fix UEFI and Tiano Decompression logic issue
https://bugzilla.tianocore.org/show_bug.cgi?id=1317 This is a regression issue caused by 684db6da64bc7b5faee4e1174e801c245f563b5c. 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> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> (cherry picked from commit ade71c52a49d659b20c0b433fb11ddb4f4f543c4)
-rw-r--r--IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
index cb8c7004d4..3bf34b4365 100644
--- a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
+++ b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
@@ -634,6 +634,12 @@ Decode (
BytesRemain--;
}
+ //
+ // Once mOutBuf is fully filled, directly return
+ //
+ if (Sd->mOutBuf >= Sd->mOrigSize) {
+ goto Done ;
+ }
}
}