Skip to content

Commit

Permalink
[PATCH] Fix ppc32 zImage inflate
Browse files Browse the repository at this point in the history
The recent zlib update (commit 4f3865f)
broke ppc32 zImage decompression as it tries to decompress to address zero
and the updated zlib_inflate checks that strm->next_out isn't a null
pointer.

This little patch fixes it.

[[email protected]: add comment]
Signed-off-by: Peter Korsgaard <[email protected]>
Acked-by: Tom Rini <[email protected]>
Signed-off-by: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jacmet authored and Linus Torvalds committed Jul 31, 2006
1 parent 163ecdf commit 31925c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/zlib_inflate/inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,10 @@ int zlib_inflate(z_streamp strm, int flush)
static const unsigned short order[19] = /* permutation of code lengths */
{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};

if (strm == NULL || strm->state == NULL || strm->next_out == NULL ||
/* Do not check for strm->next_out == NULL here as ppc zImage
inflates to strm->next_out = 0 */

if (strm == NULL || strm->state == NULL ||
(strm->next_in == NULL && strm->avail_in != 0))
return Z_STREAM_ERROR;

Expand Down

0 comments on commit 31925c8

Please sign in to comment.