diff options
| author | Richard Purdie <rpurdie@rpsys.net> | 2007-05-06 17:51:56 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:13:04 -0400 |
| commit | f0ac675806441d17303707856f4d23bd27092014 (patch) | |
| tree | 558cabe05bbff24241d54ef92619259d10b01dd9 | |
| parent | c24228daa1e489721812815838220de607260df9 (diff) | |
Fix ppp_deflate issues with recent zlib_inflate changes
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 <rpurdie@rpsys.net>
Cc: Stefan Wenk <stefan.wenk@gmx.at>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| -rw-r--r-- | lib/zlib_inflate/inflate.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c index fceb97c3aff7..7e1e3114a73e 100644 --- a/lib/zlib_inflate/inflate.c +++ b/lib/zlib_inflate/inflate.c | |||
| @@ -743,12 +743,14 @@ int zlib_inflate(z_streamp strm, int flush) | |||
| 743 | 743 | ||
| 744 | strm->data_type = state->bits + (state->last ? 64 : 0) + | 744 | strm->data_type = state->bits + (state->last ? 64 : 0) + |
| 745 | (state->mode == TYPE ? 128 : 0); | 745 | (state->mode == TYPE ? 128 : 0); |
| 746 | if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) | ||
| 747 | ret = Z_BUF_ERROR; | ||
| 748 | 746 | ||
| 749 | if (flush == Z_PACKET_FLUSH && ret == Z_OK && | 747 | if (flush == Z_PACKET_FLUSH && ret == Z_OK && |
| 750 | (strm->avail_out != 0 || strm->avail_in == 0)) | 748 | strm->avail_out != 0 && strm->avail_in == 0) |
| 751 | return zlib_inflateSyncPacket(strm); | 749 | return zlib_inflateSyncPacket(strm); |
| 750 | |||
| 751 | if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) | ||
| 752 | ret = Z_BUF_ERROR; | ||
| 753 | |||
| 752 | return ret; | 754 | return ret; |
| 753 | } | 755 | } |
| 754 | 756 | ||
