Re: [Boost-bugs] [Boost C++ Libraries] #8735: boost::format crashes on "%0%" format string

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8735: boost::format crashes on "%0%" format string
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-10-12 16:38:22


#8735: boost::format crashes on "%0%" format string
-------------------------------+--------------------------------
  Reporter: oliora@… | Owner: James E. King, III
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: format
   Version: Boost 1.51.0 | Severity: Problem
Resolution: invalid | Keywords: format
-------------------------------+--------------------------------
Changes (by James E. King, III):

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

Comment:

 There is no crash in this case, but an unhandled exception which is the
 responsibility of the consuming application. I will add the following
 unit test anyway, but the report is invalid.

 {{{
 jking_at_ubuntu:~/boost/libs/format/test$ git diff HEAD
 diff --git a/test/format_test3.cpp b/test/format_test3.cpp
 index 231a91b..6cc9a65 100644
 --- a/test/format_test3.cpp
 +++ b/test/format_test3.cpp
 @@ -128,5 +128,8 @@ int test_main(int, char* [])
      std::string arg; // empty string
      s = str(format("%=8s") % arg);

 + // https://svn.boost.org/trac10/ticket/8735
 + BOOST_CHECK_THROW(s = str(format("%0%") % 1234567),
 boost::io::bad_format_string);
 +
      return 0;
  }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/8735#comment:2>
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-10-12 16:49:40 UTC