Subject: [Boost-bugs] [Boost C++ Libraries] #5908: iostreams gzip fails to handle optional extra fields in gzip header
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-09-17 21:33:55
#5908: iostreams gzip fails to handle optional extra fields in gzip header
------------------------------------------------------+---------------------
Reporter: Travis Abbott <typedef.struct@â¦> | Owner: turkanis
Type: Bugs | Status: new
Milestone: To Be Determined | Component: iostreams
Version: Boost 1.47.0 | Severity: Problem
Keywords: gzip |
------------------------------------------------------+---------------------
When bit 2 (FEXTRA) is set in a gzip header's flags, the iostreams code
fails to read the XLEN field before starting to read the extra comment.
The code is actually there to do it, but it gets skipped. This means the
code goes directly a loop like: while (--xlen != 0) with xlen still set to
0. This results in the rest of the file being slurped in by this comment
reading code (or at least until xlen wraps around to 0 again, which could
take awhile). I ran into this because many popular file formats in
bioinformatics (BAM, tabix) are gzipped and include extra optional fields
in their headers.
I've attached an example gzipped file with an optional header, a test
program that should demonstrate the problem (against 1.47 and latest svn),
as well as a patch that fixes it.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5908> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC