[Boost-bugs] [Boost C++ Libraries] #6834: Memory corruption when calling boost::filesystem::exists() from static initializer with Unicode paths

Subject: [Boost-bugs] [Boost C++ Libraries] #6834: Memory corruption when calling boost::filesystem::exists() from static initializer with Unicode paths
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-04-26 20:00:26


#6834: Memory corruption when calling boost::filesystem::exists() from static
initializer with Unicode paths
------------------------------------------------+---------------------------
 Reporter: memger@… | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.49.0 | Severity: Problem
 Keywords: filesystem access violation exists |
------------------------------------------------+---------------------------
 Assume we have a class MyClass with the constructor as shown below.
 Now, if we create a static instance of MyClass (or have some other
 mechanism to execute this code at static initialization time), then this
 code will create an access violation exception when exists() is called.

 {{{
 MyClass::MyClass() {
         boost::filesystem::path path(L"C:\\Windows");
         path /= boost::filesystem::path(L"notepad.exe");
         if (!boost::filesystem::exists(path)) {
                 std::cout << "notepad.exe doesn't exist!" << std::endl;
         }
 }
 }}}

 The code was tested on Windows 7 X64 SP1 with VS 2008 SP1 with boost 1.49.

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