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

Commits without email cause panic()'s #28

Closed
ghost opened this issue Nov 2, 2016 · 1 comment
Closed

Commits without email cause panic()'s #28

ghost opened this issue Nov 2, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Nov 2, 2016

When you have a commit done by an author not having an email address, followed by a push to the repository hosted in Gogs, the method "newSignatureFromCommitline" causes a panic().

It is triggered at signature.go:30 which incorrectly assumes an email address is always entered.

panic: runtime error: slice bounds out of range [recovered]
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
panic(0xd8d900, 0xc4200120e0)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/urfave/cli.HandleAction.func1(0xc42026b940)
/home/vagrant/gopath/src/github.com/urfave/cli/app.go:478 +0x247
panic(0xd8d900, 0xc4200120e0)
/usr/local/go/src/runtime/panic.go:458 +0x243
github.com/gogits/git-module.newSignatureFromCommitline(0xc420170c65, 0x20, 0x59b, 0x6, 0xffffffffffffff01, 0x6)
/home/vagrant/gopath/src/github.com/gogits/git-module/signature.go:30 +0x489
github.com/gogits/git-module.parseCommitData(0xc420170c00, 0xdc, 0x600, 0xc420170c00, 0xdc, 0x600)
/home/vagrant/gopath/src/github.com/gogits/git-module/repo_commit.go:70 +0x3de
github.com/gogits/git-module.(*Repository).getCommit(0xc4204273e0, 0xa07ed8f8c22f15b8, 0xc698db97c4bfc470, 0xc698db97f4913a13, 0xf4913a13, 0x0, 0x0)
/home/vagrant/gopath/src/github.com/gogits/git-module/repo_commit.go:108 +0x40e
github.com/gogits/git-module.(*Repository).GetCommit(0xc4204273e0, 0xc420423770, 0x28, 0xa, 0x0, 0x0)
/home/vagrant/gopath/src/github.com/gogits/git-module/repo_commit.go:133 +0x88
github.com/gogits/gogs/models.PushUpdate(0x1b, 0xc4204241b0, 0xc, 0xc420411028, 0x6, 0xc42039ac27, 0xa, 0xc420426e20, 0x11, 0xc4204236e0, ...)
/home/vagrant/gopath/src/github.com/gogits/gogs/models/update.go:140 +0x6ba
github.com/gogits/gogs/cmd.handleUpdateTask(0xc420422ea0, 0x24, 0xc420417000, 0xc42015ec00, 0xc42039ac27, 0xa, 0x0)
/home/vagrant/gopath/src/github.com/gogits/gogs/cmd/serve.go:111 +0x361
github.com/gogits/gogs/cmd.runServ(0xc420321040, 0x0, 0x0)
/home/vagrant/gopath/src/github.com/gogits/gogs/cmd/serve.go:279 +0xcd4
reflect.Value.call(0xd632e0, 0xef59f0, 0x13, 0xe5a833, 0x4, 0xc42026b900, 0x1, 0x1, 0x475128, 0xe42fe0, ...)
/usr/local/go/src/reflect/value.go:434 +0x5c8
reflect.Value.Call(0xd632e0, 0xef59f0, 0x13, 0xc42026b900, 0x1, 0x1, 0x0, 0xc42026b8e0, 0x47e056)
/usr/local/go/src/reflect/value.go:302 +0xa4
github.com/urfave/cli.HandleAction(0xd632e0, 0xef59f0, 0xc420321040, 0x0, 0x0)
/home/vagrant/gopath/src/github.com/urfave/cli/app.go:487 +0x1e0
github.com/urfave/cli.Command.Run(0xe5b2d7, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe8d556, 0x2f, 0x0, ...)
/home/vagrant/gopath/src/github.com/urfave/cli/command.go:186 +0xc2b
github.com/urfave/cli.(*App).Run(0xc420338000, 0xc42000c200, 0x4, 0x4, 0x0, 0x0)
/home/vagrant/gopath/src/github.com/urfave/cli/app.go:240 +0x611
main.main()
/home/vagrant/gopath/src/github.com/gogits/gogs/gogs.go:41 +0x321

@unknwon
Copy link
Member

unknwon commented Dec 8, 2016

Thanks your feedback!

Can you given an example repository that contains such commit, so I can test against it?

@unknwon unknwon closed this as completed Dec 24, 2016
sapk pushed a commit to sapk-fork/git-module that referenced this issue Mar 8, 2017
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