Re: [Boost-bugs] [Boost C++ Libraries] #2970: Out of boundary access with STLport (was: Out of boundary access with STLPort)

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2970: Out of boundary access with STLport (was: Out of boundary access with STLPort)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-05-29 06:27:02


#2970: Out of boundary access with STLport
---------------------------+------------------------------------------------
  Reporter: Jazz | Owner: nasonov
      Type: Bugs | Status: new
 Milestone: Boost 1.39.0 | Component: lexical_cast
   Version: Boost 1.38.0 | Severity: Problem
Resolution: | Keywords:
---------------------------+------------------------------------------------
Changes (by eckhardt):

 * cc: eckhardt (added)

Comment:

 The expression 's[s.size()]' is okay on a string, as long as 's' refers to
 a const string. Now, it would be interesting which version of STLport you
 have and how it behaves, i.e. how you detected a misbehaviour, because a
 missing zero would be a bug there.

 The code in question is this:
 {{{
             std::string const& grouping = np.grouping();
             [...]
             char last_grp_size = grouping[0] <= 0 ? CHAR_MAX :
 grouping[0];
             // a) Since grouping is const, grouping[grouping.size()]
 returns 0.
 }}}

 Note especially the comment, which basically repeats what I wrote above.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2970#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:00 UTC