diff options
author | rvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-02 23:58:58 +0000 |
---|---|---|
committer | rvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-02 23:58:58 +0000 |
commit | e89069d6d473e4cd22dc62bb5acc593f0632c933 (patch) | |
tree | e7ee09dc5d3551a9b32b2278e85a4c3b43654d0e /base/files | |
parent | 984036f134fe384cfe55d40080aeab82d6a959ca (diff) | |
download | chromium_src-e89069d6d473e4cd22dc62bb5acc593f0632c933.zip chromium_src-e89069d6d473e4cd22dc62bb5acc593f0632c933.tar.gz chromium_src-e89069d6d473e4cd22dc62bb5acc593f0632c933.tar.bz2 |
Base: FileEnumerator should not follow reparse points.
Following reparse points by default is dangerous because it can easily result
in infinite loops.
BUG=260360
TEST=base_unittests
Review URL: https://chromiumcodereview.appspot.com/20610004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215407 0039d316-1c4b-4281-b951-d872f2087c98
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; |