summaryrefslogtreecommitdiffstats
path: root/models/gpg_key.go
diff options
context:
space:
mode:
authorSagePtr <sageptr@gmail.com>2018-09-20 07:49:07 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2018-09-20 13:49:07 +0800
commit043ab2cd5902dedad0e9f743dada85dfbcb613de (patch)
tree37e5477094a3cdebb4f9931e9e9c135f19555aae /models/gpg_key.go
parent8b113cd8b6c6517f0b10222ab14be3fa3ce777ef (diff)
downloadgitea-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.go2
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