From ae9f38e17802f9848258ffe5f671c08fe356e616 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 18 Feb 2017 13:04:34 +0000 Subject: [PATCH] de-fuzz: Failed Pearl verbs should fail better and louder. --- include/boost/regex/v4/basic_regex_parser.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/boost/regex/v4/basic_regex_parser.hpp b/include/boost/regex/v4/basic_regex_parser.hpp index ff0d4373..74bf0d46 100644 --- a/include/boost/regex/v4/basic_regex_parser.hpp +++ b/include/boost/regex/v4/basic_regex_parser.hpp @@ -479,7 +479,8 @@ bool basic_regex_parser::parse_open_paren() // now recursively add more states, this will terminate when we get to a // matching ')' : // - parse_all(); + if(!parse_all()) + return false; // // Unwind pushed alternatives: // @@ -2860,6 +2861,10 @@ bool basic_regex_parser::parse_perl_verb() } break; } + // Rewind to start of (* sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; }