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.
This commit is contained in:
Glenn L McGrath 2001-11-29 06:36:56 +00:00
parent 8a35c9a557
commit 38288bbf4c
3 changed files with 24 additions and 0 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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();