Index: base/path_service.cc |
diff --git a/base/path_service.cc b/base/path_service.cc |
index 2697653b39ef1699ad330814fdd54e9e3227b2f7..aa53b0d0eba81efd25747b3f26f1b83d8695a54f 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); |