Opened 13 years ago
Closed 13 years ago
#3352 closed Patches (fixed)
CRC not correctly computed on x64 during decompression of gzip archive
Reported by: | Owned by: | Jonathan Turkanis | |
---|---|---|---|
Milestone: | Boost 1.41.0 | Component: | iostreams |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | x64 64bit gzip iostreams | Cc: |
Description
A difference in datatypes causes an overflow error (or lack thereof).
Steps to reproduce:
- Generate a gzip archive of sufficient size (140K?)
- Decompress with iostreams filter.
Attached: Proposed change to zlib typedefs
Tested on Kubuntu x86 & Debian x64
Attachments (1)
Change History (6)
by , 13 years ago
Attachment: | boost_zlib.diff added |
---|
comment:1 by , 13 years ago
Line of fault is:
crc_ += value << (offset_ * 8);
in gzip.cpp
When the shift results in a large negative value, the 32bit crc should roll over. But long on x64 is 64bit and the result is incorrect.
comment:2 by , 13 years ago
Milestone: | Boost 1.40.0 → Boost 1.41.0 |
---|
comment:3 by , 13 years ago
Type: | Bugs → Patches |
---|
comment:4 by , 13 years ago
Note:
See TracTickets
for help on using tickets.
Patch