[Boost-bugs] [Boost C++ Libraries] #3650: Text Serialization crashes when istream close unexpectedly

Subject: [Boost-bugs] [Boost C++ Libraries] #3650: Text Serialization crashes when istream close unexpectedly
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-11-20 13:40:52


#3650: Text Serialization crashes when istream close unexpectedly
-------------------------------------+--------------------------------------
 Reporter: Doug Wallas | Owner:
     Type: Bugs | Status: new
Milestone: Boost 1.42.0 | Component: None
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 I am using TextSerialization over a tcp::iostream.
 I am retrieving object pointers through the serialization mecanisms.

 boost::archive::text_iarchive ia(*_stream);
 while(!_stream->eof())
 {
    boost::shared_ptr<Message> msg;
    ia >> msg;
    ...
 }

 If the socket stream close unexpectedly, then the program goes to fault.

 It seems that moving the check for stream failure after the data reads in
 the basic_text_iprimitive.hpp file fixes the problem.

 Thanks

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