mirror of
https://github.com/boostorg/regex.git
synced 2025-07-21 08:12:37 +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));
|
||||
}
|
||||
if(idx < 0)
|
||||
{
|
||||
ok = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
while(p)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
if(!ok)
|
||||
{
|
||||
// recursion to sub-expression that doesn't exist:
|
||||
|
Reference in New Issue
Block a user