Skip to content

Commit 043ab2c

Browse files
SagePtrlunny
authored andcommitted
Fix null pointer dereference in ParseCommitWithSignature (#4962)
1 parent 8b113cd commit 043ab2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/gpg_key.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ func verifySign(s *packet.Signature, h hash.Hash, k *GPGKey) error {
360360

361361
// ParseCommitWithSignature check if signature is good against keystore.
362362
func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
363-
if c.Signature != nil {
363+
if c.Signature != nil && c.Committer != nil {
364364
//Parsing signature
365365
sig, err := extractSignature(c.Signature.Signature)
366366
if err != nil { //Skipping failed to extract sign

0 commit comments

Comments
 (0)