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

fix gpg API panic when no verification #1451

Merged
merged 2 commits into from
Apr 7, 2017

Conversation

lunny
Copy link
Member

@lunny lunny commented Apr 5, 2017

fix #1383 @sapk please help to confirm.

@lunny lunny added the type/bug label Apr 5, 2017
@lunny lunny added this to the 1.2.0 milestone Apr 5, 2017
@@ -45,6 +45,11 @@ func ToCommit(c *git.Commit) *api.PayloadCommit {
committerUsername = committer.Name
}
verif := models.ParseCommitWithSignature(c)
var signature, payload string
if verif.Verified {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be c.Signature != nil because Verified could be false because we didn't validated the sign but the commit is signed.

@sapk
Copy link
Member

sapk commented Apr 6, 2017

Not tested but LGTM

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 6, 2017
@sapk
Copy link
Member

sapk commented Apr 6, 2017

Thx for the quick fix of my mistake.

@appleboy
Copy link
Member

appleboy commented Apr 6, 2017

LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 6, 2017
@strk
Copy link
Member

strk commented Apr 6, 2017

Trusted LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 6, 2017
@lunny lunny merged commit cf6699f into go-gitea:master Apr 7, 2017
@lunny lunny deleted the lunny/fix_gpg_api branch April 19, 2017 05:51
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GPG commit validation causes nil pointer dereference in API
5 participants