From ade71c52a49d659b20c0b433fb11ddb4f4f543c4 Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Fri, 9 Nov 2018 07:58:16 +0800 Subject: [PATCH] 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 Reviewed-by: Yonghong Zhu --- .../BaseUefiTianoCustomDecompressLib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c index 39999a07c3..970795b1da 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 ; + } } }