Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0ac6758 authored by Richard Purdie's avatar Richard Purdie Committed by Linus Torvalds
Browse files

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: default avatarRichard Purdie <rpurdie@rpsys.net>
Cc: Stefan Wenk <stefan.wenk@gmx.at>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c24228da
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -743,12 +743,14 @@ int zlib_inflate(z_streamp strm, int flush)


    strm->data_type = state->bits + (state->last ? 64 : 0) +
    strm->data_type = state->bits + (state->last ? 64 : 0) +
                      (state->mode == TYPE ? 128 : 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 &&
    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);
		return zlib_inflateSyncPacket(strm);

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

    return ret;
    return ret;
}
}