fix cve issue 42506269

This commit is contained in:
Christian Mazakas
2025-02-14 15:22:30 -08:00
parent 0b64ecef6c
commit 187be72eb8
5 changed files with 33 additions and 1 deletions

View File

@ -997,7 +997,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
if((m_position != m_end)
&& (0 == (this->flags() & regbase::main_option_type))
&& (this->m_traits.syntax_type(*m_position) == regex_constants::syntax_plus))
{
{
possessive = true;
++m_position;
}
@ -1114,6 +1114,13 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
else
contin = false;
break;
case regex_constants::syntax_hash:
if (this->flags() & regex_constants::mod_x) {
while((m_position != m_end) && !is_separator(*m_position++)){}
contin = true;
break;
}
BOOST_REGEX_FALLTHROUGH;
default:
contin = false;
}

View File

@ -19,6 +19,8 @@
#ifndef BOOST_REGEX_V5_REGBASE_HPP
#define BOOST_REGEX_V5_REGBASE_HPP
#include <boost/regex/config.hpp>
namespace boost{
//
// class regbase