| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "storage/browser/database/database_util.h" | 5 #include "storage/browser/database/database_util.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "storage/browser/database/database_tracker.h" | 10 #include "storage/browser/database/database_tracker.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 full_path = full_path.InsertBeforeExtensionASCII( | 94 full_path = full_path.InsertBeforeExtensionASCII( |
| 95 base::UTF16ToASCII(sqlite_suffix)); | 95 base::UTF16ToASCII(sqlite_suffix)); |
| 96 } | 96 } |
| 97 // Watch out for directory traversal attempts from a compromised renderer. | 97 // Watch out for directory traversal attempts from a compromised renderer. |
| 98 if (full_path.value().find(FILE_PATH_LITERAL("..")) != | 98 if (full_path.value().find(FILE_PATH_LITERAL("..")) != |
| 99 base::FilePath::StringType::npos) | 99 base::FilePath::StringType::npos) |
| 100 return base::FilePath(); | 100 return base::FilePath(); |
| 101 return full_path; | 101 return full_path; |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool DatabaseUtil::IsValidOriginIdentifier( | |
| 105 const std::string& origin_identifier) { | |
| 106 return GetOriginFromIdentifier(origin_identifier).is_valid(); | |
| 107 } | |
| 108 | |
| 109 } // namespace storage | 104 } // namespace storage |
| OLD | NEW |