mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
TestCaseReader: Disallow UNC paths along with absolute ones
This commit is contained in:
parent
34425c351d
commit
e841479b4b
@ -159,7 +159,9 @@ pair<SourceMap, size_t> TestCaseReader::parseSourcesAndSettingsWithLineNumber(is
|
|||||||
soltestAssert(!externalSourceName.empty(), "");
|
soltestAssert(!externalSourceName.empty(), "");
|
||||||
fs::path externalSourceTarget(externalSourceString);
|
fs::path externalSourceTarget(externalSourceString);
|
||||||
fs::path testCaseParentDir = m_fileName.parent_path();
|
fs::path testCaseParentDir = m_fileName.parent_path();
|
||||||
if (!externalSourceTarget.is_relative())
|
if (!externalSourceTarget.is_relative() || !externalSourceTarget.root_path().empty())
|
||||||
|
// NOTE: UNC paths (ones starting with // or \\) are considered relative by Boost
|
||||||
|
// since they have an empty root directory (but non-empty root name).
|
||||||
BOOST_THROW_EXCEPTION(runtime_error("External Source paths need to be relative to the location of the test case."));
|
BOOST_THROW_EXCEPTION(runtime_error("External Source paths need to be relative to the location of the test case."));
|
||||||
fs::path externalSourceFullPath = testCaseParentDir / externalSourceTarget;
|
fs::path externalSourceFullPath = testCaseParentDir / externalSourceTarget;
|
||||||
string externalSourceContent;
|
string externalSourceContent;
|
||||||
|
Loading…
Reference in New Issue
Block a user