aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-10-12 22:56:38 +0000
committerTed Kremenek <kremenek@apple.com>2012-10-12 22:56:38 +0000
commit7642b9a55e853c27531e078da34ca95148182c3d (patch)
tree263bfe6888c5b5233a0b05429d0c24157d2464e2 /tools
parent441ee1dfa5ff8d904ad07dc3b7837c44d9f173eb (diff)
Further harden checking that scan-view isn't serving up pages outside
the server root. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165839 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/scan-view/ScanView.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/scan-view/ScanView.py b/tools/scan-view/ScanView.py
index 3e03f1a6a3..32570b9858 100644
--- a/tools/scan-view/ScanView.py
+++ b/tools/scan-view/ScanView.py
@@ -708,8 +708,8 @@ File Bug</h3>
def send_path(self, path):
# If the requested path is outside the root directory, do not open it
- rel = os.path.relpath(path, self.server.root)
- if rel.startswith(os.pardir + os.sep):
+ rel = os.path.abspath(os.path.join(self.server.root, path))
+ if not rel.startswith(os.path.abspath(self.server.root) ):
return self.send_404()
ctype = self.guess_type(path)