mirror of
https://github.com/boostorg/regex.git
synced 2025-07-21 16:22:43 +02:00
de-fuzz: need to fail when a named recursive subexpression refers to an invalid name.
This commit is contained in:
@ -801,6 +801,12 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
|
|||||||
//
|
//
|
||||||
idx = m_pdata->get_id(static_cast<int>(idx));
|
idx = m_pdata->get_id(static_cast<int>(idx));
|
||||||
}
|
}
|
||||||
|
if(idx < 0)
|
||||||
|
{
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
while(p)
|
while(p)
|
||||||
{
|
{
|
||||||
if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == idx))
|
if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == idx))
|
||||||
@ -846,6 +852,7 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
|
|||||||
}
|
}
|
||||||
p = p->next.p;
|
p = p->next.p;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(!ok)
|
if(!ok)
|
||||||
{
|
{
|
||||||
// recursion to sub-expression that doesn't exist:
|
// recursion to sub-expression that doesn't exist:
|
||||||
|
Reference in New Issue
Block a user