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

Unified Diff: chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc

Issue 139543005: Reject filesystem root entries as args for chrome.fileSystem functions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 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 | chrome/browser/extensions/api/file_system/file_system_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc
diff --git a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc
index d8e3480fe2405ae7c58514167792f499394b8578..94a172ecaf1fba1eadcb873c209c813c3eb5349a 100644
--- a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc
+++ b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc
@@ -350,6 +350,11 @@ bool ValidateFileEntryAndGetPath(
const content::RenderViewHost* render_view_host,
base::FilePath* file_path,
std::string* error) {
+ if (filesystem_path.empty()) {
+ *error = kInvalidParameters;
+ return false;
+ }
+
std::string filesystem_id;
if (!fileapi::CrackIsolatedFileSystemName(filesystem_name, &filesystem_id)) {
*error = kInvalidParameters;
« no previous file with comments | « no previous file | chrome/browser/extensions/api/file_system/file_system_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698