diff options
Diffstat (limited to 'base/files')
-rw-r--r-- | base/files/file_enumerator_win.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/base/files/file_enumerator_win.cc b/base/files/file_enumerator_win.cc index 64c9845..e47f542 100644 --- a/base/files/file_enumerator_win.cc +++ b/base/files/file_enumerator_win.cc @@ -133,8 +133,10 @@ FilePath FileEnumerator::Next() { if (recursive_) { // If |cur_file| is a directory, and we are doing recursive searching, // add it to pending_paths_ so we scan it after we finish scanning this - // directory. - pending_paths_.push(cur_file); + // directory. However, don't do recursion through reparse points or we + // may end up with an infinite cycle. + if (!(find_data_.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) + pending_paths_.push(cur_file); } if (file_type_ & FileEnumerator::DIRECTORIES) return cur_file; |