Ticket #5900 (closed Bugs: fixed)
Access violation in boost filesystem 3 directory iterator
|Reported by:||Andreas Eckleder <a.eckleder@…>||Owned by:||bemandawes|
Whenever dir_itr_increment() reports an error (e.g. because an error code was returned by FindNextFile?() on WIN32), directory_iterator_increment() will crash with an access violation when trying to throw a filesystem error.
The access violation is caused by an attempt to read the parent path string from it.m_imp immediately after calling it.m_imp.reset().
Please find a patch against boost 1.47.0 attached to this ticket. It fixes the issue without any side-effects by storing the parent path locally before calling it.m_imp.reset().
The issue is hard to reproduce as essentially a defective file-system is required to see its effect. However, I think it should be sufficiently clear from the patch what's going on. I ran across this when trying to read from an optical disc with a defective UDF file-system.