Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-02-07 21:31:09


Oliver.Kowalke_at_[hidden] wrote:
> Hello,
> I don't know why in basic_test_iprimitive::load the stream isn't
> tested
> for eof or fail after reading from it?

because archives should never read beyond the end of the stream.
The current version does this but this is an oversight which will be
correctedin the next release.

> In my case I get a string-resize-exception thrown because it is not
> tested for eof or fail after
> 'is >> t' (text_iarchive_impl.ipp line 48; size is not initialized and
> contains a to huge number which causes a resize exception on line 55).

> This was raised from the stream which was connected to a socket. The
> peer has closed the socket and the read operation on the socket has
> returned EOF.

The fix is in test_oarchive_impl.ipp which will invoke os << std::endl
when the archive is closed. This should be sufficient that the stream
is never read beyond EOF.

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk