diff options
Diffstat (limited to 'src/path/filepath/path_test.go')
| -rw-r--r-- | src/path/filepath/path_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/path/filepath/path_test.go b/src/path/filepath/path_test.go index 672d7e6261..9adf641013 100644 --- a/src/path/filepath/path_test.go +++ b/src/path/filepath/path_test.go @@ -106,6 +106,13 @@ var wincleantests = []PathTest{ {`//abc`, `\\abc`}, {`///abc`, `\\\abc`}, {`//abc//`, `\\abc\\`}, + + // Don't allow cleaning to move an element with a colon to the start of the path. + {`a/../c:`, `.\c:`}, + {`a\..\c:`, `.\c:`}, + {`a/../c:/a`, `.\c:\a`}, + {`a/../../c:`, `..\c:`}, + {`foo:bar`, `foo:bar`}, } func TestClean(t *testing.T) { @@ -174,6 +181,7 @@ var winislocaltests = []IsLocalTest{ {`C:`, false}, {`C:\a`, false}, {`..\a`, false}, + {`a/../c:`, false}, {`CONIN$`, false}, {`conin$`, false}, {`CONOUT$`, false}, |
