diff options
Diffstat (limited to 'src/path/filepath/match.go')
| -rw-r--r-- | src/path/filepath/match.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/path/filepath/match.go b/src/path/filepath/match.go index 2adb0c7490..9fa68f578d 100644 --- a/src/path/filepath/match.go +++ b/src/path/filepath/match.go @@ -250,6 +250,11 @@ func Glob(pattern string) (matches []string, err error) { return glob(dir, file, nil) } + // Prevent infinite recursion. See issue 15879. + if dir == pattern { + return nil, ErrBadPattern + } + var m []string m, err = Glob(dir) if err != nil { |
