Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for ErrBadPattern (0.46 sec)

  1. src/io/fs/glob_test.go

    		}
    	}
    }
    
    func TestGlobError(t *testing.T) {
    	bad := []string{`[]`, `nonexist/[]`}
    	for _, pattern := range bad {
    		_, err := Glob(os.DirFS("."), pattern)
    		if err != path.ErrBadPattern {
    			t.Errorf("Glob(fs, %#q) returned err=%v, want path.ErrBadPattern", pattern, err)
    		}
    	}
    }
    
    func TestCVE202230630(t *testing.T) {
    	// Prior to CVE-2022-30630, a stack exhaustion would occur given a large
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 18:36:52 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  2. src/path/filepath/match_test.go

    	{"[]a]", "]", false, ErrBadPattern},
    	{"[-]", "-", false, ErrBadPattern},
    	{"[x-]", "x", false, ErrBadPattern},
    	{"[x-]", "-", false, ErrBadPattern},
    	{"[x-]", "z", false, ErrBadPattern},
    	{"[-x]", "x", false, ErrBadPattern},
    	{"[-x]", "-", false, ErrBadPattern},
    	{"[-x]", "a", false, ErrBadPattern},
    	{"\\", "a", false, ErrBadPattern},
    	{"[a-b-c]", "a", false, ErrBadPattern},
    	{"[", "a", false, ErrBadPattern},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 22 16:38:19 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  3. src/path/filepath/match.go

    	if len(chunk) == 0 || chunk[0] == '-' || chunk[0] == ']' {
    		err = ErrBadPattern
    		return
    	}
    	if chunk[0] == '\\' && runtime.GOOS != "windows" {
    		chunk = chunk[1:]
    		if len(chunk) == 0 {
    			err = ErrBadPattern
    			return
    		}
    	}
    	r, n := utf8.DecodeRuneInString(chunk)
    	if r == utf8.RuneError && n == 1 {
    		err = ErrBadPattern
    	}
    	nchunk = chunk[n:]
    	if len(nchunk) == 0 {
    		err = ErrBadPattern
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  4. src/testing/fstest/testfs.go

    				}
    			}
    			elem[i] = string(pattern)
    		}
    		glob = strings.Join(elem, "/") + "/"
    	}
    
    	// Test that malformed patterns are detected.
    	// The error is likely path.ErrBadPattern but need not be.
    	if _, err := t.fsys.(fs.GlobFS).Glob(glob + "nonexist/[]"); err == nil {
    		t.errorf("%s: Glob(%#q): bad pattern not detected", dir, glob+"nonexist/[]")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  5. src/cmd/go/internal/fsys/fsys.go

    		dir = cleanGlobPath(dir)
    	}
    
    	if !hasMeta(dir[volumeLen:]) {
    		return glob(dir, file, nil)
    	}
    
    	// Prevent infinite recursion. See issue 15879.
    	if dir == pattern {
    		return nil, filepath.ErrBadPattern
    	}
    
    	var m []string
    	m, err = Glob(dir)
    	if err != nil {
    		return
    	}
    	for _, d := range m {
    		matches, err = glob(d, file, matches)
    		if err != nil {
    			return
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 18:35:34 UTC 2024
    - 22.7K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"Base", Func, 0},
    		{"Clean", Func, 0},
    		{"Dir", Func, 0},
    		{"ErrBadPattern", Var, 0},
    		{"Ext", Func, 0},
    		{"IsAbs", Func, 0},
    		{"Join", Func, 0},
    		{"Match", Func, 0},
    		{"Split", Func, 0},
    	},
    	"path/filepath": {
    		{"Abs", Func, 0},
    		{"Base", Func, 0},
    		{"Clean", Func, 0},
    		{"Dir", Func, 0},
    		{"ErrBadPattern", Var, 0},
    		{"EvalSymlinks", Func, 0},
    		{"Ext", Func, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top