diff options
author | SagePtr <sageptr@gmail.com> | 2018-09-20 07:49:07 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2018-09-20 13:49:07 +0800 |
commit | 043ab2cd5902dedad0e9f743dada85dfbcb613de (patch) | |
tree | 37e5477094a3cdebb4f9931e9e9c135f19555aae /models/gpg_key.go | |
parent | 8b113cd8b6c6517f0b10222ab14be3fa3ce777ef (diff) | |
download | gitea-043ab2cd5902dedad0e9f743dada85dfbcb613de.tar.gz gitea-043ab2cd5902dedad0e9f743dada85dfbcb613de.zip |
Fix null pointer dereference in ParseCommitWithSignature (#4962)
Diffstat (limited to 'models/gpg_key.go')
-rw-r--r-- | models/gpg_key.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/gpg_key.go b/models/gpg_key.go index 45da889504..c9b57caaa6 100644 --- a/models/gpg_key.go +++ b/models/gpg_key.go @@ -360,7 +360,7 @@ func verifySign(s *packet.Signature, h hash.Hash, k *GPGKey) error { // ParseCommitWithSignature check if signature is good against keystore. func ParseCommitWithSignature(c *git.Commit) *CommitVerification { - if c.Signature != nil { + if c.Signature != nil && c.Committer != nil { //Parsing signature sig, err := extractSignature(c.Signature.Signature) if err != nil { //Skipping failed to extract sign |