Opened 16 years ago

Closed 16 years ago

#631 closed Bugs (Accepted)

Bug in xml_oarchive_impl<Archive>::save(const std::string&)

Reported by: alexey-b Owned by: Robert Ramey
Milestone: Component: serialization
Version: None Severity:
Keywords: Cc:

Description

Bug in file "boost/archive/impl/xml_oarchive_impl.ipp" 
line 82 method:
template<class Archive>
BOOST_ARCHIVE_DECL(void)
xml_oarchive_impl<Archive>::save(const std::string & s
).
Second argument of call:
std::copy(
xml_escape_translator(BOOST_MAKE_PFTO_WRAPPER(s.data()
)),
xml_escape_translator(BOOST_MAKE_PFTO_WRAPPER(s.data()+ 
s.size())), 
boost::archive::iterators::ostream_iterator<char>(os))
is wrong: in constructor of xml_escape_translator the 
method
template<class Base>
char xml_escape<Base>::fill(
    const char * & bstart, 
    const char * & bend) is called for after-last 
symbol!!! If this symbol is, e.g., '>' - we have error: 
iterators _First and _Last in call of std::copy (see 
above) are always not equal (members 'm_bnext' and 
'm_bend' are always non-zero and comparation of these 
iterators in this case are return always 'false') and 
we have access violation.

Change History (4)

comment:1 by Robert Ramey, 16 years ago

Logged In: YES 
user_id=396141

I previously checked in a correction to escape.hpp which I 
believe addresses this problem.  Its in Boost CVS 
RC_1_34_0 .  You might try this and see it resolves your 
case.  The error I corrected came up in the context of 
STLPort 5.0 which doesn't terminate strings with NULL.

Robert Ramey

comment:2 by Robert Ramey, 16 years ago

Logged In: YES 
user_id=396141

Thank you for submitting a bug report to BOOST

comment:3 by sf-robot, 16 years ago

Logged In: YES 
user_id=1312539

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

comment:4 by sf-robot, 16 years ago

Status: assignedclosed
Note: See TracTickets for help on using tickets.