Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Gitparse message fix (#1125)
Bill Richae2d510ced44
diff --git a/pkg/gitparse/gitparse.go b/pkg/gitparse/gitparse.goindex 6f1afa0ff..2fae9ebcf 100644--- a/pkg/gitparse/gitparse.go+++ b/pkg/gitparse/gitparse.go@@ -241,14 +241,17 @@ func (c *Parser) fromReader(ctx context.Context, stdOut io.Reader, commitChan chtotalSize += diff.Content.Len()}if totalSize > c.maxCommitSize {+ oldCommit := currentCommitcommitChan <- *currentCommitcurrentCommit = &Commit{Hash: currentCommit.Hash,Author: currentCommit.Author,Date: currentCommit.Date,- Message: currentCommit.Message,+ Message: strings.Builder{},Diffs: []Diff{},}+ // Message needs to be recreated here otherwise writing to it again will result in a panic.+ currentCommit.Message.WriteString(oldCommit.Message.String())}}currentDiff = &Diff{}