[U-Boot] [PATCH] Fix gunzip in case of insufficient output buffer

Wolfgang Denk wd at denx.de
Tue Jan 27 20:59:21 CET 2009


Dear Matthias Fuchs,

In message <200901021511.42036.matthias.fuchs at 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 <matthias.fuchs at esd-electronics.com>
> ---
>  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.


More information about the U-Boot mailing list