Opened 10 years ago

#7517 new Bugs

indirect_streambuf: invalid state change if write() writes less data then requested

Reported by: Oleg Liatte <oleg.liatte@…> Owned by: Jonathan Turkanis
Milestone: To Be Determined Component: iostreams
Version: Boost 1.49.0 Severity: Problem
Keywords: write fail duplication buffer consistency Cc:

Description

Currently indirect_streambuf::sync_impl() calls setp() to update pbase() without any regard to current pbase() value. With unreliable write() it will lead to buffer consistency loss and data duplication if write() doesn't satisfy request fully two or more times in a row.

As a solution setp() should use pbase() as current buffer begin instead of out().begin(). See patch.

Attachments (1)

indirect_streambuf.hpp.patch (493 bytes ) - added by Oleg Liatte <oleg.liatte@…> 10 years ago.

Download all attachments as: .zip

Change History (1)

by Oleg Liatte <oleg.liatte@…>, 10 years ago

Note: See TracTickets for help on using tickets.