]> source.dussan.org Git - gitea.git/commitdiff
Fix null pointer dereference in ParseCommitWithSignature (#4962)
authorSagePtr <sageptr@gmail.com>
Thu, 20 Sep 2018 05:49:07 +0000 (07:49 +0200)
committerLunny Xiao <xiaolunwen@gmail.com>
Thu, 20 Sep 2018 05:49:07 +0000 (13:49 +0800)
models/gpg_key.go

index 45da889504ac64beb753792b6f5fd714ee73ab34..c9b57caaa606889fd507ccb6c7996050a478aad4 100644 (file)
@@ -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