Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug20742. Fix detection of invalid inflate headers
when creating an inflate-stream, one can optionally have the stream automatically detect and skip gzip or zlib headers and trailers. If the first byte checked (via read-byte) was an invalid header byte, we attempt to unread the byte read in via unread-char. 1. It is an error to unread-char when no read-char has been performed. 2. If the stream has a multi-byte external-format, the unread-char may inadvertently be unreading a multi-byte octet or invalid character. The fix made here is to bind the stream-external-format to :latin1, saving the original external-format and restoring it via an unwind-protect. Then, read-char is used to check the first byte, and unread-byte is used if the char does not match the expected first byte of a gzip or zlib stream. Are there user visible changes in this commit? yes/no Is bootstrapping needed? yes/no Are tests included for new features? Possible answers: Tests run: none / make all / other (specify) Change-Id: I6d431b80fba1fa92ad1e0b4fc6a9732e49484316
- Loading branch information
Mikel Bancroft
committed
Jan 25, 2012
1 parent
3811035
commit caf951e
Showing
2 changed files
with
61 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters