Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Handle nil file channel (#417)
Dustin Decker879e65b5c5d7
diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.goindex 862462b37..54648aeee 100644--- a/pkg/sources/git/git.go+++ b/pkg/sources/git/git.go@@ -272,6 +272,10 @@ func (s *Git) ScanCommits(repo *git.Repository, path string, scanOptions *ScanOpif err != nil {return errors.WrapPrefix(err, "could not open repo path", 0)}+ // parser can return nil chan and nil error+ if fileChan == nil {+ return errors.New("nothing to scan")+ }// get the URL metadata for reporting (may be empty)urlMetadata := getSafeRemoteURL(repo, "origin")