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

Unified Diff: base/platform_file.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 | « base/platform_file.h ('k') | base/platform_file_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/platform_file.cc
===================================================================
--- base/platform_file.cc (revision 175576)
+++ base/platform_file.cc (working copy)
@@ -14,4 +14,15 @@
PlatformFileInfo::~PlatformFileInfo() {}
+PlatformFile CreatePlatformFile(const FilePath& name,
+ int flags,
+ bool* created,
+ PlatformFileError* error) {
+ if (name.ReferencesParent()) {
+ *error = PLATFORM_FILE_ERROR_ACCESS_DENIED;
+ return kInvalidPlatformFileValue;
+ }
+ return CreatePlatformFileUnsafe(name, flags, created, error);
+}
+
} // namespace base
« no previous file with comments | « base/platform_file.h ('k') | base/platform_file_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698