From 452bbfc179d6739a404aacc819ec66acc71fc55c Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 19 Oct 2016 00:01:31 -0400 Subject: path/filepath: fix match of \\?\c:\* on Windows \\?\c:\ is a "root directory" that is not subject to further matching, but the ? makes it look like a pattern, which was causing an infinite recursion. Make sure the code understands the ? is not a pattern. Fixes #15879. Change-Id: I3a4310bbc398bcae764b9f8859c875317345e757 Reviewed-on: https://go-review.googlesource.com/31460 Reviewed-by: Quentin Smith --- src/path/filepath/path_windows_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/path/filepath/path_windows_test.go') diff --git a/src/path/filepath/path_windows_test.go b/src/path/filepath/path_windows_test.go index 8d552d06f7..6393629ccc 100644 --- a/src/path/filepath/path_windows_test.go +++ b/src/path/filepath/path_windows_test.go @@ -12,6 +12,7 @@ import ( "os/exec" "path/filepath" "reflect" + "runtime/debug" "strings" "testing" ) @@ -413,3 +414,10 @@ func TestToNorm(t *testing.T) { } } } + +func TestUNC(t *testing.T) { + // Test that this doesn't go into an infinite recursion. + // See golang.org/issue/15879. + defer debug.SetMaxStack(debug.SetMaxStack(1e6)) + filepath.Glob(`\\?\c:\*`) +} -- cgit v1.3