Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72540 - trunk/boost/regex/v4
From: john_at_[hidden]
Date: 2011-06-10 13:03:49


Author: johnmaddock
Date: 2011-06-10 13:03:48 EDT (Fri, 10 Jun 2011)
New Revision: 72540
URL: http://svn.boost.org/trac/boost/changeset/72540

Log:
Fix access violation caused by past-the-end iterator deference for expressions such as ".*?".
Text files modified:
   trunk/boost/regex/v4/basic_regex_parser.hpp | 3 ++-
   1 files changed, 2 insertions(+), 1 deletions(-)

Modified: trunk/boost/regex/v4/basic_regex_parser.hpp
==============================================================================
--- trunk/boost/regex/v4/basic_regex_parser.hpp (original)
+++ trunk/boost/regex/v4/basic_regex_parser.hpp 2011-06-10 13:03:48 EDT (Fri, 10 Jun 2011)
@@ -941,7 +941,8 @@
          ++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;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk