From 056abd2059c65a3e908193aeae16fad98017437c Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 2 Dec 2012 13:20:44 +0000 Subject: Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2): http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974 --- tools/scan-view/ScanView.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools/scan-view/ScanView.py') diff --git a/tools/scan-view/ScanView.py b/tools/scan-view/ScanView.py index c6dddba..32570b9 100644 --- a/tools/scan-view/ScanView.py +++ b/tools/scan-view/ScanView.py @@ -707,6 +707,11 @@ File Bug return None def send_path(self, path): + # If the requested path is outside the root directory, do not open it + 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) if ctype.startswith('text/'): # Patch file instead -- cgit v1.1