mirror of
https://github.com/boostorg/regex.git
synced 2025-07-19 23:32:10 +02:00
Fix some Valgrind reported issues in regex parsing.
[SVN r78940]
This commit is contained in:
@ -660,6 +660,11 @@ template <class charT, class traits>
|
|||||||
bool basic_regex_parser<charT, traits>::parse_extended_escape()
|
bool basic_regex_parser<charT, traits>::parse_extended_escape()
|
||||||
{
|
{
|
||||||
++m_position;
|
++m_position;
|
||||||
|
if(m_position == m_end)
|
||||||
|
{
|
||||||
|
fail(regex_constants::error_escape, m_position - m_base, "Incomplete escape sequence found.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
bool negate = false; // in case this is a character class escape: \w \d etc
|
bool negate = false; // in case this is a character class escape: \w \d etc
|
||||||
switch(this->m_traits.escape_syntax_type(*m_position))
|
switch(this->m_traits.escape_syntax_type(*m_position))
|
||||||
{
|
{
|
||||||
@ -2089,6 +2094,14 @@ insert_recursion:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
v = this->m_traits.toi(m_position, m_end, 10);
|
v = this->m_traits.toi(m_position, m_end, 10);
|
||||||
|
if(m_position == m_end)
|
||||||
|
{
|
||||||
|
// Rewind to start of (? sequence:
|
||||||
|
--m_position;
|
||||||
|
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||||
|
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if(*m_position == charT('R'))
|
if(*m_position == charT('R'))
|
||||||
{
|
{
|
||||||
if(++m_position == m_end)
|
if(++m_position == m_end)
|
||||||
|
Reference in New Issue
Block a user