diff options
| author | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-11-29 06:36:56 +0000 |
|---|---|---|
| committer | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-11-29 06:36:56 +0000 |
| commit | dcfb49e05446cbf8979dff0e8366c2015a25e0c9 (patch) | |
| tree | 066a61cd46f32b2aab2012e405e7ee1cbbc7898c | |
| parent | dcec966bb3f5f4bbfc25de37a827d5110a2ef78d (diff) | |
| download | busybox-w32-dcfb49e05446cbf8979dff0e8366c2015a25e0c9.tar.gz busybox-w32-dcfb49e05446cbf8979dff0e8366c2015a25e0c9.tar.bz2 busybox-w32-dcfb49e05446cbf8979dff0e8366c2015a25e0c9.zip | |
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.
git-svn-id: svn://busybox.net/trunk/busybox@3815 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -rw-r--r-- | archival/libunarchive/decompress_unzip.c | 8 | ||||
| -rw-r--r-- | archival/libunarchive/unzip.c | 8 | ||||
| -rw-r--r-- | libbb/unzip.c | 8 |
3 files changed, 24 insertions, 0 deletions
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c index bb32891be..69cc8198b 100644 --- a/archival/libunarchive/decompress_unzip.c +++ b/archival/libunarchive/decompress_unzip.c | |||
| @@ -875,6 +875,14 @@ static int inflate(void) | |||
| 875 | } | 875 | } |
| 876 | } while (!e); | 876 | } while (!e); |
| 877 | 877 | ||
| 878 | /* Undo too much lookahead. The next read will be byte aligned so we | ||
| 879 | * can discard unused bits in the last meaningful byte. | ||
| 880 | */ | ||
| 881 | while (bk >= 8) { | ||
| 882 | bk -= 8; | ||
| 883 | ungetc((bb << bk), in_file); | ||
| 884 | } | ||
| 885 | |||
| 878 | /* flush out window */ | 886 | /* flush out window */ |
| 879 | flush_window(); | 887 | flush_window(); |
| 880 | 888 | ||
diff --git a/archival/libunarchive/unzip.c b/archival/libunarchive/unzip.c index bb32891be..69cc8198b 100644 --- a/archival/libunarchive/unzip.c +++ b/archival/libunarchive/unzip.c | |||
| @@ -875,6 +875,14 @@ static int inflate(void) | |||
| 875 | } | 875 | } |
| 876 | } while (!e); | 876 | } while (!e); |
| 877 | 877 | ||
| 878 | /* Undo too much lookahead. The next read will be byte aligned so we | ||
| 879 | * can discard unused bits in the last meaningful byte. | ||
| 880 | */ | ||
| 881 | while (bk >= 8) { | ||
| 882 | bk -= 8; | ||
| 883 | ungetc((bb << bk), in_file); | ||
| 884 | } | ||
| 885 | |||
| 878 | /* flush out window */ | 886 | /* flush out window */ |
| 879 | flush_window(); | 887 | flush_window(); |
| 880 | 888 | ||
diff --git a/libbb/unzip.c b/libbb/unzip.c index bb32891be..69cc8198b 100644 --- a/libbb/unzip.c +++ b/libbb/unzip.c | |||
| @@ -875,6 +875,14 @@ static int inflate(void) | |||
| 875 | } | 875 | } |
| 876 | } while (!e); | 876 | } while (!e); |
| 877 | 877 | ||
| 878 | /* Undo too much lookahead. The next read will be byte aligned so we | ||
| 879 | * can discard unused bits in the last meaningful byte. | ||
| 880 | */ | ||
| 881 | while (bk >= 8) { | ||
| 882 | bk -= 8; | ||
| 883 | ungetc((bb << bk), in_file); | ||
| 884 | } | ||
| 885 | |||
| 878 | /* flush out window */ | 886 | /* flush out window */ |
| 879 | flush_window(); | 887 | flush_window(); |
| 880 | 888 | ||
