Boost C++ Libraries: Ticket #11163: generator::set_default_messages_domain either crashes or have unexpected side effects https://svn.boost.org/trac10/ticket/11163 <p> Calling generator::set_default_messages_domain before calling generator::add_messages_domain using the same domain results in calling vector::erase using an invalid iterator, which results in a crash. </p> <p> Calling generator::set_default_messages_domain after calling generator::add_messages_domain using the same domain results in adding the domain twice to the vector. </p> <p> This is due to using operator== instead of operator!= when comparing iterator to vector::end(). </p> <p> Fix: </p> <pre class="wiki">void generator::set_default_messages_domain(std::string const &amp;domain) { std::vector&lt;std::string&gt;::iterator p; if((p=std::find(d-&gt;domains.begin(),d-&gt;domains.end(),domain)) != d-&gt;domains.end()) { d-&gt;domains.erase(p); } d-&gt;domains.insert(d-&gt;domains.begin(),domain); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11163 Trac 1.4.3 Akira Takahashi <faithandbrave@…> Thu, 12 Nov 2015 05:09:29 GMT <link>https://svn.boost.org/trac10/ticket/11163#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11163#comment:1</guid> <description> <p> This issue fixed? The issue is listed to Boost 1.60.0 release-note. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Artyom Beilis</dc:creator> <pubDate>Thu, 12 Nov 2015 06:14:21 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11163#comment:2 https://svn.boost.org/trac10/ticket/11163#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> Fixed in 1.60 </p> Ticket