diff options
author | Glenn L McGrath | 2001-11-29 06:36:56 +0000 |
---|---|---|
committer | Glenn L McGrath | 2001-11-29 06:36:56 +0000 |
commit | 38288bbf4cb26be1d1b3ee9175666d6819892a9e (patch) | |
tree | 066a61cd46f32b2aab2012e405e7ee1cbbc7898c /archival | |
parent | 8a35c9a5575a32cebf0f160f77fada930dcffc5d (diff) | |
download | busybox-38288bbf4cb26be1d1b3ee9175666d6819892a9e.zip busybox-38288bbf4cb26be1d1b3ee9175666d6819892a9e.tar.gz |
gunzip was incorrectly reporting a failed crc and length (discovered by
Chang, Shu-Hao). The bitbuffer needs to be unwound after decompression,
as it was eating into the crc/size field.
Diffstat (limited to 'archival')
-rw-r--r-- | archival/libunarchive/decompress_unzip.c | 8 | ||||
-rw-r--r-- | archival/libunarchive/unzip.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c index bb32891..69cc819 100644 --- a/archival/libunarchive/decompress_unzip.c +++ b/archival/libunarchive/decompress_unzip.c @@ -875,6 +875,14 @@ static int inflate(void) } } while (!e); + /* Undo too much lookahead. The next read will be byte aligned so we + * can discard unused bits in the last meaningful byte. + */ + while (bk >= 8) { + bk -= 8; + ungetc((bb << bk), in_file); + } + /* flush out window */ flush_window(); diff --git a/archival/libunarchive/unzip.c b/archival/libunarchive/unzip.c index bb32891..69cc819 100644 --- a/archival/libunarchive/unzip.c +++ b/archival/libunarchive/unzip.c @@ -875,6 +875,14 @@ static int inflate(void) } } while (!e); + /* Undo too much lookahead. The next read will be byte aligned so we + * can discard unused bits in the last meaningful byte. + */ + while (bk >= 8) { + bk -= 8; + ungetc((bb << bk), in_file); + } + /* flush out window */ flush_window(); |