summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/ppb_file_ref_impl.cc
diff options
context:
space:
mode:
authorsanga@chromium.org <sanga@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-17 16:41:53 +0000
committersanga@chromium.org <sanga@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-17 16:41:53 +0000
commit6529b0ec599e083d54f9031cc37150ae93b368a2 (patch)
tree0056cadfd7a67df328634930b66794959c24add7 /webkit/plugins/ppapi/ppb_file_ref_impl.cc
parent2c144bceae0a0ec69aad3cbabe1f9c3f9692416b (diff)
downloadchromium_src-6529b0ec599e083d54f9031cc37150ae93b368a2.zip
chromium_src-6529b0ec599e083d54f9031cc37150ae93b368a2.tar.gz
chromium_src-6529b0ec599e083d54f9031cc37150ae93b368a2.tar.bz2
Adding checks against directory traversal.
BUG= http://code.google.com/p/chromium/issues/detail?id=92751 TEST=ui_tests Review URL: http://codereview.chromium.org/7631007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97144 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/ppb_file_ref_impl.cc')
-rw-r--r--webkit/plugins/ppapi/ppb_file_ref_impl.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/webkit/plugins/ppapi/ppb_file_ref_impl.cc b/webkit/plugins/ppapi/ppb_file_ref_impl.cc
index 1db9a22..00d5db4 100644
--- a/webkit/plugins/ppapi/ppb_file_ref_impl.cc
+++ b/webkit/plugins/ppapi/ppb_file_ref_impl.cc
@@ -33,7 +33,7 @@ namespace {
bool IsValidLocalPath(const std::string& path) {
// The path must start with '/'
- if (path.empty() || path[0] != '/')
+ if (path.empty() || path[0] != '/' || path.find("..") != std::string::npos)
return false;
// The path must contain valid UTF-8 characters.