Skip to content

Find, verify, and analyze leaked credentials

Check that required info is present (#415)

Bill Rich09de492ec9c4
diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go
index e13335040..862462b37 100644
--- a/pkg/sources/git/git.go
+++ b/pkg/sources/git/git.go
@@ -279,6 +279,10 @@ func (s *Git) ScanCommits(repo *git.Repository, path string, scanOptions *ScanOp
var depth int64
var reachedBase = false
for file := range fileChan {
+ if file == nil || file.PatchHeader == nil {
+ log.Debugf("file missing patch header, skipping")
+ continue
+ }
log.WithField("commit", file.PatchHeader.SHA).WithField("file", file.NewName).Trace("Scanning file from git")
if scanOptions.MaxDepth > 0 && depth >= scanOptions.MaxDepth {
log.Debugf("reached max depth")