Boost C++ Libraries: Ticket #969: basic_binary_iprimitive::load_binary bug https://svn.boost.org/trac10/ticket/969 <p> boost\archive\basic_binary_iprimitive.hpp, line 163, line 174. Now code: </p> <pre class="wiki"> if(count != static_cast&lt;std::size_t&gt;(s)) ... if(count != 1) </pre><p> Need: </p> <pre class="wiki"> if(scount != static_cast&lt;std::size_t&gt;(s)) ... if(scount != 1) </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/969 Trac 1.4.3 Dave Abrahams Wed, 11 Jul 2007 01:07:10 GMT owner set https://svn.boost.org/trac10/ticket/969#comment:1 https://svn.boost.org/trac10/ticket/969#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Robert Ramey</span> </li> </ul> Ticket Marvin Sielenkemper <Marvin.Sielenkemper@…> Thu, 11 Oct 2007 11:25:50 GMT <link>https://svn.boost.org/trac10/ticket/969#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/969#comment:2</guid> <description> <p> There is another bug in this function that causes the test </p> <pre class="wiki"> void BoostBinaryWArchiveBug() { const std::string srcValue("12345"); std::string dstValue; std::wostringstream os; boost::archive::binary_woarchive(os) &lt;&lt; srcValue; std::wistringstream is(os.str()); boost::archive::binary_wiarchive(is) &gt;&gt; dstValue; BOOST_CHECK_EQUAL(srcValue, dstValue); } </pre><p> to fail with the error message </p> <pre class="wiki">error in "BoostBinaryWArchiveBug": check srcValue == dstValue failed [12345 != 5234] </pre><p> I found that bug in version 1.33.1, but the problem seems to still be present in 1.34.1. The bug is fixed by changing the memcpy-line from </p> <pre class="wiki"> std::memcpy(address, &amp;t, s); </pre><p> to </p> <pre class="wiki"> std::memcpy(static_cast&lt;char*&gt;(address) + (count - s), &amp;t, s); </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Fri, 30 Nov 2007 01:59:49 GMT</pubDate> <title>status, severity changed; resolution set https://svn.boost.org/trac10/ticket/969#comment:3 https://svn.boost.org/trac10/ticket/969#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>severity</strong> <span class="trac-field-old">Showstopper</span> → <span class="trac-field-new">Problem</span> </li> </ul> <p> I'll put this in. </p> Ticket