public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Liming Gao <liming.gao@intel.com>
To: edk2-devel@lists.01.org
Cc: Michael Kinney <michael.d.kinney@intel.com>
Subject: [Patch 2/3] MdePkg BaseUefiDecompressLib: Fix UEFI Decompression logic issue
Date: Fri,  9 Nov 2018 07:58:15 +0800	[thread overview]
Message-ID: <1541721496-13332-3-git-send-email-liming.gao@intel.com> (raw)
In-Reply-To: <1541721496-13332-1-git-send-email-liming.gao@intel.com>

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>
---
 MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c
index 9fc637e058..c1e8c5581a 100644
--- a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c
+++ b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c
@@ -641,6 +641,12 @@ Decode (
 
         BytesRemain--;
       }
+      //
+      // Once mOutBuf is fully filled, directly return
+      //
+      if (Sd->mOutBuf >= Sd->mOrigSize) {
+        goto Done;
+      }
     }
   }
 
-- 
2.16.2.windows.1



  parent reply	other threads:[~2018-11-08 23:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08 23:58 [Patch 0/3] Fix UEFI and Tiano Decompression logic issue Liming Gao
2018-11-08 23:58 ` [Patch 1/3] BaseTools: " Liming Gao
2018-11-09  2:44   ` Zhu, Yonghong
2018-11-08 23:58 ` Liming Gao [this message]
2018-11-08 23:58 ` [Patch 3/3] IntelFrameworkModulePkg: " Liming Gao
2018-11-10  8:53 ` [Patch 0/3] " Zhu, Yonghong
2018-11-10 14:18   ` Gao, Liming
2018-11-11 12:19     ` Leif Lindholm
2018-11-14  0:34       ` Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1541721496-13332-3-git-send-email-liming.gao@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox