Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76629 - in trunk/libs/filesystem/v3: doc src
From: bdawes_at_[hidden]
Date: 2012-01-21 16:34:52


Author: bemandawes
Date: 2012-01-21 16:34:51 EST (Sat, 21 Jan 2012)
New Revision: 76629
URL: http://svn.boost.org/trac/boost/changeset/76629

Log:
Fix directory_iterator access violation on Windows if error is thrown (#5900). Thanks to Andreas Eckleder for the patch.
Text files modified:
   trunk/libs/filesystem/v3/doc/release_history.html | 8 +++++++-
   trunk/libs/filesystem/v3/src/operations.cpp | 5 +++--
   2 files changed, 10 insertions(+), 3 deletions(-)

Modified: trunk/libs/filesystem/v3/doc/release_history.html
==============================================================================
--- trunk/libs/filesystem/v3/doc/release_history.html (original)
+++ trunk/libs/filesystem/v3/doc/release_history.html 2012-01-21 16:34:51 EST (Sat, 21 Jan 2012)
@@ -36,6 +36,12 @@
   </tr>
 </table>
 
+<h2>1.49.0</h2>
+<ul>
+ <li>Fix directory_iterator access violation on Windows if error is thrown
+ (#5900). Thanks to Andreas Eckleder for the patch.</li>
+</ul>
+
 <h2>1.48.0</h2>
 <ul>
   <li>Added operational function canonical(),
@@ -88,7 +94,7 @@
 </ul>
 <hr>
 <p>Revised
-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->03 October, 2011<!--webbot bot="Timestamp" endspan i-checksum="38359" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->21 January, 2012<!--webbot bot="Timestamp" endspan i-checksum="38504" --></p>
 <p>© Copyright Beman Dawes, 2011</p>
 <p> Use, modification, and distribution are subject to the Boost Software
 License, Version 1.0. See <a href="http://www.boost.org/LICENSE_1_0.txt">

Modified: trunk/libs/filesystem/v3/src/operations.cpp
==============================================================================
--- trunk/libs/filesystem/v3/src/operations.cpp (original)
+++ trunk/libs/filesystem/v3/src/operations.cpp 2012-01-21 16:34:51 EST (Sat, 21 Jan 2012)
@@ -2168,13 +2168,14 @@
 # endif
         filename, file_stat, symlink_file_stat);
 
- if (temp_ec)
+ if (temp_ec) // happens if filesystem is corrupt, such as on a damaged optical disc
       {
+ path error_path(it.m_imp->dir_entry.path().parent_path()); // fix ticket #5900
         it.m_imp.reset();
         if (ec == 0)
           BOOST_FILESYSTEM_THROW(
             filesystem_error("boost::filesystem::directory_iterator::operator++",
- it.m_imp->dir_entry.path().parent_path(),
+ error_path,
               error_code(BOOST_ERRNO, system_category())));
         ec->assign(BOOST_ERRNO, system_category());
         return;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk