From 27ad285fbf2ef5a64deaa5ef66b5f72fe1dd3f62 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 10 Jun 2011 17:03:48 +0000 Subject: [PATCH] Fix access violation caused by past-the-end iterator deference for expressions such as ".*?". [SVN r72540] --- include/boost/regex/v4/basic_regex_parser.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/regex/v4/basic_regex_parser.hpp b/include/boost/regex/v4/basic_regex_parser.hpp index 0192a9f1..f9d4399b 100644 --- a/include/boost/regex/v4/basic_regex_parser.hpp +++ b/include/boost/regex/v4/basic_regex_parser.hpp @@ -941,7 +941,8 @@ bool basic_regex_parser::parse_repeat(std::size_t low, std::size_ ++m_position; } // for perl regexes only check for pocessive ++ repeats. - if((0 == (this->flags() & regbase::main_option_type)) + if((m_position != m_end) + && (0 == (this->flags() & regbase::main_option_type)) && (this->m_traits.syntax_type(*m_position) == regex_constants::syntax_plus)) { pocessive = true;