Skip to content

Commit

Permalink
Fix ppp_deflate issues with recent zlib_inflate changes
Browse files Browse the repository at this point in the history
The last zlib_inflate update broke certain corner cases for ppp_deflate
decompression handling.  This patch fixes some logic to make things work
properly again.  Users other than ppp_deflate (the only Z_PACKET_FLUSH
user) should be unaffected.

Fixes bug 8405 (confirmed by Stefan)

Signed-off-by: Richard Purdie <[email protected]>
Cc: Stefan Wenk <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rpurdie authored and Linus Torvalds committed May 7, 2007
1 parent c24228d commit f0ac675
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/zlib_inflate/inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,12 +743,14 @@ int zlib_inflate(z_streamp strm, int flush)

strm->data_type = state->bits + (state->last ? 64 : 0) +
(state->mode == TYPE ? 128 : 0);
if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
ret = Z_BUF_ERROR;

if (flush == Z_PACKET_FLUSH && ret == Z_OK &&
(strm->avail_out != 0 || strm->avail_in == 0))
strm->avail_out != 0 && strm->avail_in == 0)
return zlib_inflateSyncPacket(strm);

if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
ret = Z_BUF_ERROR;

return ret;
}

Expand Down

0 comments on commit f0ac675

Please sign in to comment.