Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Add newlines when file is split (#937)
Bill Rich79cae3b82b77
diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.goindex 2096a2db4..522405b28 100644--- a/pkg/sources/git/git.go+++ b/pkg/sources/git/git.go@@ -408,7 +408,9 @@ func (s *Git) gitChunk(ctx context.Context, diff gitparse.Diff, fileName, email,newChunkBuffer := bytes.Buffer{}lastOffset := 0for offset := 0; originalChunk.Scan(); offset++ {- line := originalChunk.Bytes()+ line := make([]byte, len(originalChunk.Bytes())+1)+ copy(line, originalChunk.Bytes())+ line[len(line)-1] = byte('\n')if len(line) > sources.ChunkSize || len(line)+newChunkBuffer.Len() > sources.ChunkSize {// Add oversize chunk infoif newChunkBuffer.Len() > 0 {