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

Unified Diff: webkit/common/database/database_identifier.cc

Issue 199153003: Look closer at the components of vfsfilenames that are used filenames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « webkit/browser/database/database_util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/common/database/database_identifier.cc
diff --git a/webkit/common/database/database_identifier.cc b/webkit/common/database/database_identifier.cc
index 332dfb8b0cc4ec7ad1c596e19dff76b59d565d4d..8867dc15e587c5e752c1efc37a61f5f512a23989 100644
--- a/webkit/common/database/database_identifier.cc
+++ b/webkit/common/database/database_identifier.cc
@@ -58,6 +58,13 @@ DatabaseIdentifier DatabaseIdentifier::CreateFromOrigin(const GURL& origin) {
DatabaseIdentifier DatabaseIdentifier::Parse(const std::string& identifier) {
if (!IsStringASCII(identifier))
return DatabaseIdentifier();
+ if (identifier.find("..") != std::string::npos)
+ return DatabaseIdentifier();
+ char forbidden[] = {'\\', '/', ':' ,'\0'};
michaeln 2014/03/18 22:32:46 i've relocated these checks into DatabaseIdentifie
+ if (identifier.find_first_of(forbidden, 0, arraysize(forbidden)) !=
+ std::string::npos) {
+ return DatabaseIdentifier();
+ }
size_t first_underscore = identifier.find_first_of('_');
if (first_underscore == std::string::npos || first_underscore == 0)
« no previous file with comments | « webkit/browser/database/database_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698