From: Wolfgang Denk Date: Tue, 27 Jan 2009 20:59:21 +0100 Subject: [U-Boot] [PATCH] Fix gunzip in case of insufficient output buffer In-Reply-To: <200901021511.42036.matthias.fuchs@esd-electronics.com> References: <200901021511.42036.matthias.fuchs@esd-electronics.com> Message-ID: <20090127195921.54CF0832E416@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Matthias Fuchs, In message <200901021511.42036.matthias.fuchs@esd-electronics.com> you wrote: > U-Boot's gunzip() function does not handle the return code > of zlib's inflate() function correctly. gunzip() is implemented > to uncompress all input data in one run. So the correct return > code for the good case is Z_STREAM_END. In case of insufficient > output buffer memory inflate returns Z_OK. For gunzip() this > is an error. > > It also makes sense to me to call inflateEnd() also in case > of an error. > > Signed-off-by: Matthias Fuchs > --- > common/cmd_bootm.c | 2 +- > lib_generic/gunzip.c | 3 ++- > 2 files changed, 3 insertions(+), 2 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de HEALTH WARNING: Care Should Be Taken When Lifting This Product, Since Its Mass, and Thus Its Weight, Is Dependent on Its Velocity Relative to the User.