diff options
-rw-r--r-- | base/base_paths_mac.mm | 3 | ||||
-rw-r--r-- | base/path_service.cc | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/base/base_paths_mac.mm b/base/base_paths_mac.mm index d217d90..630f742 100644 --- a/base/base_paths_mac.mm +++ b/base/base_paths_mac.mm @@ -90,9 +90,6 @@ bool PathProviderMac(int key, FilePath* result) { *result = result->DirName().DirName(); } #endif - if (result->ReferencesParent()) { - return file_util::AbsolutePath(result); - } return true; case base::DIR_USER_DESKTOP: #if defined(OS_IOS) diff --git a/base/path_service.cc b/base/path_service.cc index 2697653..aa53b0d 100644 --- a/base/path_service.cc +++ b/base/path_service.cc @@ -209,6 +209,12 @@ bool PathService::Get(int key, FilePath* result) { if (path.empty()) return false; + if (path.ReferencesParent()) { + // Make sure path service never returns a path with ".." in it. + if (!file_util::AbsolutePath(&path)) { + return false; + } + } *result = path; base::AutoLock scoped_lock(path_data->lock); |