From a612d4d7ae2fb7a52d6c8e75bf9fda1de10ead7e Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Thu, 1 Jan 2009 02:29:57 +0000 Subject: [PATCH] Don't try to read the next Gzip header after we reach the end of the compressed stream. This is desirable behavior, but the implementation here is very broken and causes strange problems, so disable it for now. Thanks to Simon L. Nielsen for reporting this problem. --- lib/libarchive/archive_read_support_compression_gzip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libarchive/archive_read_support_compression_gzip.c b/lib/libarchive/archive_read_support_compression_gzip.c index 1e8f818dc09..4669ea4443b 100644 --- a/lib/libarchive/archive_read_support_compression_gzip.c +++ b/lib/libarchive/archive_read_support_compression_gzip.c @@ -428,8 +428,9 @@ gzip_source_read(struct archive_read_source *self, const void **p) "Failed to clean up gzip decompressor"); return (ARCHIVE_FATAL); } - /* Restart header parser with the next block. */ - state->header_state = state->header_done = 0; + /* zlib has been torn down */ + state->header_done = 0; + state->eof = 1; /* FALL THROUGH */ case Z_OK: /* Decompressor made some progress. */ /* If we filled our buffer, update stats and return. */