Re: [Boost-bugs] [Boost C++ Libraries] #10388: null character at end of string from filesystem::temp_directory_path

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10388: null character at end of string from filesystem::temp_directory_path
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-07-29 11:03:08


#10388: null character at end of string from filesystem::temp_directory_path
-------------------------------+------------------------
  Reporter: anonymous | Owner: bemandawes
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: filesystem
   Version: Boost 1.57.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+------------------------
Changes (by anonymous):

 * status: closed => reopened
 * version: Boost 1.56.0 => Boost 1.57.0
 * resolution: fixed =>

Comment:

 The bug is not fixed as of version 1.57.
 It has nothing to do with `trailing separator'.


 Again: `The null character at end of string causes very interesting bugs
 ...'.

 The tested solution: replace lines

 '''buf.pop_back();'''

 '''path p(buf.begin(), buf.end());'''

 with

 '''path p(buf.begin());'''

 in file \libs\filesystem\src\operations.cpp

 The problem is that string returned by GetTempPathW sometimes contain 2
 null characters. That means that 1 null character becomes a part of
 returned path in buggy code, because the code makes assumption that
 returned string contains exactly 1 null character.

 ...

 Is explanation ok? Or should I just send a patch?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10388#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-02-16 18:50:18 UTC