OSDN Git Service

[llvm-cov] Do not allow ".." to escape the coverage sub-directory
authorVedant Kumar <vsk@apple.com>
Wed, 29 Jun 2016 16:22:12 +0000 (16:22 +0000)
committerVedant Kumar <vsk@apple.com>
Wed, 29 Jun 2016 16:22:12 +0000 (16:22 +0000)
commit651e3ffa9629fd0f07faabd379993113800ffcb7
tree48ad71212d4fce208595610cfb0034540863031c
parent108515eb03b4ef92c1dce129d9c8ba3a19f05450
[llvm-cov] Do not allow ".." to escape the coverage sub-directory

In -output-dir mode, file reports are placed into a "coverage"
directory. If filenames in the coverage mapping contain "..", they might
escape out of this directory.

Fix the problem by removing ".." from source filenames (expand the path
component).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274135 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-cov/Inputs/double_dots.covmapping [new file with mode: 0644]
test/tools/llvm-cov/Inputs/double_dots.proftext [new file with mode: 0644]
test/tools/llvm-cov/double_dots.c [new file with mode: 0644]
tools/llvm-cov/SourceCoverageView.cpp