Opened 14 years ago

Closed 12 years ago

#2882 closed Bugs (fixed)

infinite loop when attempting to close a filtered_stream<output> with a zlib_decompressor when extra data is appended to the stream

Reported by: Jeremy Drake <boost@…> Owned by: Jonathan Turkanis
Milestone: Boost 1.39.0 Component: iostreams
Version: Boost 1.38.0 Severity: Problem
Keywords: Cc:

Description

I ran into this while attempting to port over some code from using zlib directly. Apparently one of the compressed file formats contains a 4 byte length at the end of the zlib data. This causes zlib to return Z_STREAM_END with 4 bytes still left to write. This in turn causes an infinite loop in boost::iostreams::symmetric_filter::write, do to the fact that the return value of filter().filter is not checked.

Attachments (3)

symmetric_filter_output_infinite_loop.cpp (911 bytes ) - added by Jeremy Drake <boost@…> 14 years ago.
minimal program to reproduce
symmetric_filter_output_infinite_loop.patch (598 bytes ) - added by Jeremy Drake <boost@…> 14 years ago.
patch which seems to fix the issue
symmetric_filter_output_infinite_loop.2.patch (589 bytes ) - added by Jeremy Drake <boost@…> 14 years ago.
patch which seems to fix the issue (removed CRs, hopefully it will show up right now)

Download all attachments as: .zip

Change History (5)

by Jeremy Drake <boost@…>, 14 years ago

minimal program to reproduce

by Jeremy Drake <boost@…>, 14 years ago

patch which seems to fix the issue

by Jeremy Drake <boost@…>, 14 years ago

patch which seems to fix the issue (removed CRs, hopefully it will show up right now)

comment:1 by Jonathan Turkanis, 14 years ago

Status: newassigned

comment:2 by Steven Watanabe, 12 years ago

Resolution: fixed
Status: assignedclosed

This was fixed in the trunk as a side effect of [63031].

Note: See TracTickets for help on using tickets.