Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2689)

Unified Diff: base/file_util.cc

Issue 11782005: Don't allow path traversal paths on the base file helpers (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/platform_file.h » ('j') | base/platform_file.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.cc
===================================================================
--- base/file_util.cc (revision 175095)
+++ base/file_util.cc (working copy)
@@ -152,6 +152,8 @@
}
bool ReadFileToString(const FilePath& path, std::string* contents) {
+ if (path.ReferencesParent())
brettw 2013/01/07 20:50:26 Maybe this warrants a mention in the header as wel
+ return false;
FILE* file = OpenFile(path, "rb");
if (!file) {
return false;
« no previous file with comments | « no previous file | base/platform_file.h » ('j') | base/platform_file.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698