forked from boostorg/regex
de-fuzz: make sure recursion stack always has a valid start location for the recursion.
This commit is contained in:
@ -1719,6 +1719,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion(bool r)
|
||||
recursion_stack.back().idx = pmp->recursion_id;
|
||||
recursion_stack.back().preturn_address = pmp->preturn_address;
|
||||
recursion_stack.back().results = pmp->results;
|
||||
recursion_stack.back().location_of_start = position;
|
||||
}
|
||||
boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
|
||||
m_backup_state = pmp;
|
||||
|
@ -996,6 +996,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_match()
|
||||
recursion_stack.push_back(recursion_info<results_type>());
|
||||
recursion_stack.back().preturn_address = saved_state;
|
||||
recursion_stack.back().results = *m_presult;
|
||||
recursion_stack.back().location_of_start = position;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user