Boost C++ Libraries: Ticket #4245: encode_char_entities does not handle empty string properly (affects write_graphml) https://svn.boost.org/trac10/ticket/4245 <p> The write_graphml function uses encode_char_entities from the property_tree::xml_parser. This latter function does not behave properly when passed an empty string. </p> <p> I fixed this by modifying encode_char_entities to work properly in the empty string case. I found this preferable to patching write_graphml to be aware of the limitation of encode_char_entities. </p> <p> Attached is a sample program that crashes on my system (Snow Leopard), the output and stack trace of that crash, and a patch to trunk <a class="changeset" href="https://svn.boost.org/trac10/changeset/62110" title="Boost.Chrono 0.5: * Remove unneeded lines * Comment unused arguments ">r62110</a> which fixes the issue. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4245 Trac 1.4.3 Christopher Alfeld <alfeld@…> Thu, 20 May 2010 15:56:21 GMT attachment set https://svn.boost.org/trac10/ticket/4245 https://svn.boost.org/trac10/ticket/4245 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">demo.cpp</span> </li> </ul> <p> Program to demonstrate problems -- throws std::length_error. </p> Ticket Christopher Alfeld <alfeld@…> Thu, 20 May 2010 15:56:58 GMT attachment set https://svn.boost.org/trac10/ticket/4245 https://svn.boost.org/trac10/ticket/4245 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">output.txt</span> </li> </ul> <p> Output of program. </p> Ticket Christopher Alfeld <alfeld@…> Thu, 20 May 2010 15:57:33 GMT attachment set https://svn.boost.org/trac10/ticket/4245 https://svn.boost.org/trac10/ticket/4245 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">stacktrace.txt</span> </li> </ul> <p> Stack trace of program. </p> Ticket Christopher Alfeld <alfeld@…> Thu, 20 May 2010 15:58:13 GMT attachment set https://svn.boost.org/trac10/ticket/4245 https://svn.boost.org/trac10/ticket/4245 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_xml.patch</span> </li> </ul> <p> Patch for <a class="changeset" href="https://svn.boost.org/trac10/changeset/62110" title="Boost.Chrono 0.5: * Remove unneeded lines * Comment unused arguments ">r62110</a> trunk. </p> Ticket Christopher Alfeld <alfeld@…> Thu, 20 May 2010 16:18:58 GMT cc set https://svn.boost.org/trac10/ticket/4245#comment:1 https://svn.boost.org/trac10/ticket/4245#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">alfeld@…</span> added </li> </ul> Ticket Sebastian Redl Tue, 25 May 2010 11:54:29 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4245#comment:2 https://svn.boost.org/trac10/ticket/4245#comment:2 <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> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/62195" title="Make encode_char_entities safe against empty strings, because Graph ...">[62195]</a>) Make encode_char_entities safe against empty strings, because Graph uses it that way. Fixes bug 4245. Based on patch by Christopher Alfeld. </p> Ticket