Regex: Set a limit on how many recursions we allow.

This commit is contained in:
jzmaddock
2017-11-09 11:23:54 +00:00
parent 9f104b0664
commit 6246f5ec51
2 changed files with 22 additions and 4 deletions

View File

@ -378,7 +378,7 @@ public:
BidiIterator l_base)
: m_result(what), base(first), last(end),
position(first), backstop(l_base), re(e), traits_inst(e.get_traits()),
m_independent(false), next_count(&rep_obj), rep_obj(&next_count)
m_independent(false), next_count(&rep_obj), rep_obj(&next_count), m_recursions(0)
{
construct_init(e, f);
}
@ -566,6 +566,8 @@ private:
bool m_unwound_alt;
// We are unwinding a commit - used by independent subs to determine whether to stop there or carry on unwinding:
//bool m_unwind_commit;
// Recursion limit:
unsigned m_recursions;
#endif
// these operations aren't allowed, so are declared private,