Re: [Boost-bugs] [Boost C++ Libraries] #4636: Run-Time Check Failure #1 in feed_args.hpp using Visual Studio 2010

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4636: Run-Time Check Failure #1 in feed_args.hpp using Visual Studio 2010
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-10-11 21:32:49


#4636: Run-Time Check Failure #1 in feed_args.hpp using Visual Studio 2010
-------------------------------------+-------------------------------------
  Reporter: Rüdiger Brünner | Owner: James E. King, III
  <rbruenner@…> |
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: format
   Version: Boost 1.43.0 | Severity: Problem
Resolution: | Keywords: format Run-Time Check
                                     | Failure VS2010
-------------------------------------+-------------------------------------

Comment (by James E. King, III):

 format_item::truncate_ uses a std::streamsize which is an unsigned long
 long type, and it is initialized to a max() value for that type if the
 format specification doesn't have explicit truncation defined. The code
 that can make a string (mk_str) has a maximum size of
 std::string::size_type which is an unsigned long. This impedance mismatch
 is really the core of the issue here. The code is relying on a clamping
 mechanism that ensures a cast of the maximum stream size is a useful value
 when truncated to 32-bits. Therefore it looks like the code in the patch
 is partially correct; there are other instances that need to be addressed
 so I will work on this.

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/4636#comment:16>
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-11 21:40:28 UTC