Re: [Boost-bugs] [Boost C++ Libraries] #12300: boost::smatch::suffix() bug

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12300: boost::smatch::suffix() bug
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-06-24 17:10:23


#12300: boost::smatch::suffix() bug
--------------------------------------------+-------------------------
  Reporter: Pascal Séguy <pascal.seguy@…> | Owner: johnmaddock
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: regex
   Version: Boost 1.58.0 | Severity: Showstopper
Resolution: invalid | Keywords:
--------------------------------------------+-------------------------
Changes (by johnmaddock):

 * status: new => closed
 * resolution: => invalid

Comment:

 There's a nasty bug in your program - it's referencing dangling iterators.

 Remember that boost::smatch holds iterators into the string that you're
 matching against, as soon as you assign a new value to variable "comm"
 then all the iterators stored in "match" are now invalid. Your program is
 now entitled to crash in any way it chooses.

 This is not new behaviour: it has always been this, and is by design as
 holding iterators is so much efficient than strings.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12300#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC