Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in match.Row.matchAll #59

Open
secsys-go opened this issue Nov 11, 2022 · 0 comments
Open

Crash in match.Row.matchAll #59

secsys-go opened this issue Nov 11, 2022 · 0 comments

Comments

@secsys-go
Copy link

secsys-go commented Nov 11, 2022

#PoC

	gg, _ := glob.Compile("/{a{*.json{", '/')
	gg.Match("/a/b/c/d/e/foo.json")

#CrashLog

panic: runtime error: slice bounds out of range [:6] with length 5 [recovered]
	panic: runtime error: slice bounds out of range [:6] with length 5

goroutine 34 [running]:
testing.tRunner.func1.2({0x12047c0, 0xc00019a048})
	/Users/x/sdk/go1.17.8/src/testing/testing.go:1209 +0x24e
testing.tRunner.func1()
	/Users/x/sdk/go1.17.8/src/testing/testing.go:1212 +0x218
panic({0x12047c0, 0xc00019a048})
	/Users/x/sdk/go1.17.8/src/runtime/panic.go:1038 +0x215
github.com/gobwas/glob/match.Row.matchAll({{0xc0001641c0, 0x2, 0x2}, 0x5, {0xc00011c450, 0x1, 0x1}}, {0x12173c8, 0x5})
	/Users/x/go/pkg/mod/github.com/gobwas/glob@v0.2.3/match/row.go:34 +0x250
github.com/gobwas/glob/match.Row.Index({{0xc0001641c0, 0x2, 0x2}, 0x5, {0xc00011c450, 0x1, 0x1}}, {0x12173bc, 0x203000})
	/Users/x/go/pkg/mod/github.com/gobwas/glob@v0.2.3/match/row.go:68 +0x12c
github.com/gobwas/glob/match.BTree.Match({{0x125c078, 0xc00011ac40}, {0x125bda0, 0xc000130048}, {0x0, 0x0}, 0x5, 0xffffffffffffffff, 0x0, 0xffffffffffffffff}, ...)
	/Users/x/go/pkg/mod/github.com/gobwas/glob@v0.2.3/match/btree.go:82 +0x14a
github.com/gobwas/glob/match.BTree.Match({{0x125c190, 0xc00011ab80}, {0x0, 0x0}, {0x125be10, 0xc000124500}, 0x1, 0x0, 0xffffffffffffffff, 0xffffffffffffffff}, ...)
	/Users/x/go/pkg/mod/github.com/gobwas/glob@v0.2.3/match/btree.go:110 +0x292
github.com/gobwas/glob/match.BTree.Match({{0x125c190, 0xc00011ab40}, {0x0, 0x0}, {0x125be10, 0xc000124550}, 0x1, 0x0, 0xffffffffffffffff, 0xffffffffffffffff}, ...)
	/Users/x/go/pkg/mod/github.com/gobwas/glob@v0.2.3/match/btree.go:110 +0x292

#version
github.com/gobwas/glob v0.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant