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

[BUG] may be an out-of-boundary bug as a result of lack of necessary argument checks #2215

Closed
secsys-go opened this issue Sep 25, 2023 · 1 comment
Assignees

Comments

@secsys-go
Copy link
Contributor

Describe the bug
We used the Fuzz engine to modify some Test(TestUseRouterParentDisallow) data, and then the following crash appeared. We hope to get the help of the developer to confirm whether it is a real bug.

To Reproduce

app := iris.New()
app.PartyFunc("", func(p iris.Party) {})

Crash Log

panic: runtime error: index out of range [0] with length 0 [recovered]
	panic: runtime error: index out of range [0] with length 0

goroutine 10 [running]:
testing.tRunner.func1.2({0xc4c5c0, 0xc00045a2a0})
	D:/.../go1.20/src/testing/testing.go:1526 +0x24e
testing.tRunner.func1()
	D:/.../go1.20/src/testing/testing.go:1529 +0x39f
panic({0xc4c5c0, 0xc00045a2a0})
	D:/.../go1.20/src/runtime/panic.go:884 +0x213
github.com/kataras/iris/v12/core/router.(*APIBuilder).Party(0xc0001210e0, {0x0, 0x0}, {0x0, 0x0, 0x0})
	D:/.../iris/core/router/api_builder.go:846 +0x8f1
github.com/kataras/iris/v12/core/router.(*APIBuilder).PartyFunc(0xc0312d6078?, {0x0?, 0xc000097f60?}, 0xd4ab18)
	D:/.../iris/core/router/api_builder.go:924 +0x2a
github.com/kataras/iris/v12/core/router_test.TestUseRouterParentDisallow_POC(0x0?)
	D:/.../iris/core/router/TestUseRouterParentDisallow_POC_test.go:25 +0x2c
testing.tRunner(0xc0004829c0, 0xd4ab20)
	D:/.../go1.20/src/testing/testing.go:1576 +0x10b
created by testing.(*T).Run
	D:/.../go1.20/src/testing/testing.go:1629 +0x3ea

Expected behavior
Crash should not happen.

Desktop:

  • OS: Windows 10

iris.Version

@kataras
Copy link
Owner

kataras commented Sep 25, 2023

Hello @secsys-go, this was expected, I modified the code so if empty relative path is given is translated to "/" now. However, we don't use this empty path anywhere in our documentation or examples.

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

2 participants