Boost C++ Libraries: Ticket #5612: basic_regex class constructor stack overflow https://svn.boost.org/trac10/ticket/5612 <p> Compile and run the following code: </p> <pre class="wiki">#include &lt;boost/regex.hpp&gt; int main() { boost::regex reg("((?1)|a)"); return 0; } </pre><p> Recursive calls to basic_regex_creator&lt;charT, traits&gt;::create_startmap() would consume all available stack space and crash the program, causing denial of service. </p> <p> This problem has been verified to exist in Boost 1.46.1, and also in trunk code as of Jun. 9. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5612 Trac 1.4.3 John Maddock Thu, 16 Jun 2011 11:27:22 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5612#comment:1 https://svn.boost.org/trac10/ticket/5612#comment:1 <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/72612" title="Fix infinite recursion in bad recursive expressions. Fix bug that ...">[72612]</a>) Fix infinite recursion in bad recursive expressions. Fix bug that allows invalid regex to go unnoticed and crash later. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5613" title="#5613: Bugs: basic_regex class constructor invalid memory read (closed: fixed)">#5613</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5612" title="#5612: Bugs: basic_regex class constructor stack overflow (closed: fixed)">#5612</a>. </p> Ticket