Opened 12 years ago

Closed 12 years ago

#4677 closed Bugs (duplicate)

[filesystem] V3 filesystem::path corrupted if constructed from a local buffer

Reported by: terminatorul@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.44.0 Severity: Regression
Keywords: V3 filesystem::path corrupted Cc:

Description

With V3 filesystem in 1.44.0, boost::filesystem::remove_all() crashes if invoked with a block-local (automatic storage duration) TCHAR [] buffer for the pathname.

Looks like a filesystem::path constructed this way is corrupted. The attached example creates 3 nested directories in %TEMP% and attempts to remove them. On Windows with Visual Studio 2008 this crashes with 'bad allocation'

If the path is constructed from a string/wstring, or if an actual pointer is used to invoke remove_all(), than all is fine and no crash occurs.

To run the sample code just create an empty VC++ project and add the .cpp to it.

Attachments (1)

v3_remove_all.cpp (2.2 KB ) - added by terminatorul@… 12 years ago.
Sample source code

Download all attachments as: .zip

Change History (3)

by terminatorul@…, 12 years ago

Attachment: v3_remove_all.cpp added

Sample source code

comment:1 by Richard Hazlewood <boost@…>, 12 years ago

This looks like the issue described in #4640

comment:2 by terminatorul@…, 12 years ago

Resolution: duplicate
Status: newclosed

Indeed, it is the same bug.

Note: See TracTickets for help on using tickets.