forked from boostorg/regex
Fix infinite recursion in bad recursive expressions.
Fix bug that allows invalid regex to go unnoticed and crash later. Fixes #5613. Fixes #5612. [SVN r72612]
This commit is contained in:
@ -1026,13 +1026,14 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
|
||||
{
|
||||
//
|
||||
// Check for illegal following quantifier, we have to do this here, because
|
||||
// the extra states we insert below circumvents are usual error checking :-(
|
||||
// the extra states we insert below circumvents our usual error checking :-(
|
||||
//
|
||||
switch(this->m_traits.syntax_type(*m_position))
|
||||
{
|
||||
case regex_constants::syntax_star:
|
||||
case regex_constants::syntax_plus:
|
||||
case regex_constants::syntax_question:
|
||||
case regex_constants::syntax_open_brace:
|
||||
fail(regex_constants::error_badrepeat, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user