Skip to content

Find, verify, and analyze leaked credentials

Fix nil pointer dereference to git ScanOptions (#1603)

Miccahe322c4b29d56
diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go
index 5148c7bb6..f224ef5f7 100644
--- a/pkg/sources/git/git.go
+++ b/pkg/sources/git/git.go
@@ -115,6 +115,9 @@ func (s *Source) Init(aCtx context.Context, name string, jobId, sourceId int64,
s.sourceId = sourceId
s.jobId = jobId
s.verify = verify
+ if s.scanOptions == nil {
+ s.scanOptions = &ScanOptions{}
+ }
var conn sourcespb.Git
if err := anypb.UnmarshalTo(connection, &conn, proto.UnmarshalOptions{}); err != nil {