[Boost-bugs] [Boost C++ Libraries] #9216: format_date_parser::parse_date reads off end of format_str if it ends with a %

Subject: [Boost-bugs] [Boost C++ Libraries] #9216: format_date_parser::parse_date reads off end of format_str if it ends with a %
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-10-09 16:55:18


#9216: format_date_parser::parse_date reads off end of format_str if it ends with
a %
----------------------------------+------------------------------
 Reporter: Roger Orr <rogero@…> | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.54.0
 Severity: Problem | Keywords:
----------------------------------+------------------------------
 If boost::format_date_parser::parse_date is given a format_str such as "%"
 then the loop in date_time\format_date_parser.hpp:

 {{{#!c++

     while (itr != format_str.end() && (sitr != stream_end)) {
       if (*itr == '%') {
         itr++;
         if (*itr != '%') { // <<< ERROR here
           switch(*itr) {
           case 'a':
 }}}

 tries to dereference the one-past-the-end character on the line marked.

 With a debugging iterator (eg MSVC) this causes runtime failure.

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