[Boost-bugs] [Boost C++ Libraries] #13036: Boost.Regex: Integer overflow during calculation of max_state_count

Subject: [Boost-bugs] [Boost C++ Libraries] #13036: Boost.Regex: Integer overflow during calculation of max_state_count
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-05-18 19:27:25


#13036: Boost.Regex: Integer overflow during calculation of max_state_count
-----------------------+-------------------------------------
 Reporter: anonymous | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost Development Trunk
 Severity: Problem | Keywords: regex max_state_count
-----------------------+-------------------------------------
 {{{
 template <class BidiIterator, class Allocator, class traits>
 void perl_matcher<BidiIterator, Allocator,
 traits>::estimate_max_state_count(std::random_access_iterator_tag*)
 {
    ...
    std::ptrdiff_t states = re.size();
    if(states == 0)
       states = 1;
    states *= states; // overflows here on 32bit platforms
                      // if regex string length greater than 2**16
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/13036>
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-05-18 19:33:14 UTC