forked from boostorg/regex
Regex: Fix integer overflow in expression parsing.
See: https://oss-fuzz.com/v2/testcase-detail/6189682419302400?noredirect=1
This commit is contained in:
@ -2070,6 +2070,11 @@ insert_recursion:
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base, "An invalid or unterminated recursive sub-expression.");
|
||||
return false;
|
||||
}
|
||||
if ((std::numeric_limits<boost::intmax_t>::max)() - m_mark_count < v)
|
||||
{
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base, "An invalid or unterminated recursive sub-expression.");
|
||||
return false;
|
||||
}
|
||||
v += m_mark_count;
|
||||
goto insert_recursion;
|
||||
case regex_constants::syntax_dash:
|
||||
|
Reference in New Issue
Block a user