From b13fb44ac594400b5af78dbc2ec0fbbb742e35b0 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 3 Jan 2018 18:32:45 +0000 Subject: [PATCH] Regex.Defuzzing: Fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4659&q=jz.maddock&colspec=ID%20Type%20Component%20Status%20Proj%20Reported%20Owner%20Summary --- include/boost/regex/v4/perl_matcher_non_recursive.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/regex/v4/perl_matcher_non_recursive.hpp b/include/boost/regex/v4/perl_matcher_non_recursive.hpp index 3d89749d..79d6d76c 100644 --- a/include/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -1797,7 +1797,7 @@ bool perl_matcher::unwind_recursion_pop(bool r) // Backtracking out of a recursion, we must pop state off the recursion // stack unconditionally to ensure matched pushes and pops: saved_state* pmp = static_cast(m_backup_state); - if (!r) + if (!r && !recursion_stack.empty()) { *m_presult = recursion_stack.back().results; position = recursion_stack.back().location_of_start;