diff options
author | Rubén Rincón Blanco <ruben@rinconblanco.es> | 2021-11-21 13:45:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-21 13:45:50 +0100 |
commit | f7d77bd07e109a069d1a7ced8c8ebbd81b15db9b (patch) | |
tree | f4f4afdd13c2c015c5052de0f674a1de7fa35936 /lib/base-compiler.js | |
parent | a92083a3a4687d48f3d0ba85f5b8ae1caa0cfaa9 (diff) | |
download | compiler-explorer-f7d77bd07e109a069d1a7ced8c8ebbd81b15db9b.tar.gz compiler-explorer-f7d77bd07e109a069d1a7ced8c8ebbd81b15db9b.zip |
Modify the path include guard to fix some false-positives (#3083)gh-1281
Closes #3045
Diffstat (limited to 'lib/base-compiler.js')
-rw-r--r-- | lib/base-compiler.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/base-compiler.js b/lib/base-compiler.js index 172c012ea..25bd3c0eb 100644 --- a/lib/base-compiler.js +++ b/lib/base-compiler.js @@ -1817,7 +1817,7 @@ but nothing was dumped. Possible causes are: // to simple attempts with a clear diagnostic; the service still needs to // assume that malicious actors can make the compiler open arbitrary files. checkSource(source) { - const re = /^\s*#\s*i(nclude|mport)(_next)?\s+["<](\/|.*\.\.)[">]/; + const re = /^\s*#\s*i(nclude|mport)(_next)?\s+["<]((\.{1,2}|\/)[^">]*)[">]/; const failed = []; for (const [index, line] of utils.splitLines(source).entries()) { if (re.test(line)) { |