[Boost-bugs] [Boost C++ Libraries] #4654: restricted_filter doesn't seek with the correct offset

Subject: [Boost-bugs] [Boost C++ Libraries] #4654: restricted_filter doesn't seek with the correct offset
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-09-17 00:11:59


#4654: restricted_filter doesn't seek with the correct offset
----------------------------------------------------+-----------------------
 Reporter: la06@… | Owner: turkanis
     Type: Patches | Status: new
Milestone: | Component: iostreams
  Version: Boost Development Trunk | Severity: Showstopper
 Keywords: restrict restriction slice filter seek |
----------------------------------------------------+-----------------------
 The class restricted_filter defined in detail/restrict_impl.hpp fails to
 seek properly due to a small, but significant, error in its seek member
 function.

 The patch fixes this bug by changing the offset argument to the seek
 function of the underlying filter from
 {{{
 next
 }}}
 to
 {{{
 next - pos_
 }}}
 as the seek direction is BOOST_IOS::cur and not BOOST_IOS::beg.

 In other words, the bug causes restricted filters to seek relative to the
 current pointer using offsets relative to the beginning. If you want to
 seek forward by 10 byte at position 5000, it'll seek forward by 5010
 instead of 10.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4654>
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:04 UTC