From 213bf7e4fd449a4bb7c108fa7721e2f5d92f7a6f Mon Sep 17 00:00:00 2001 From: Miccah Date: Fri, 13 Sep 2024 11:31:31 -0700 Subject: [PATCH] Fix GitHub analyzer panic on empty organization name (#3295) --- pkg/analyzer/analyzers/github/github.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/analyzer/analyzers/github/github.go b/pkg/analyzer/analyzers/github/github.go index 8bf385e99..08dbf5842 100644 --- a/pkg/analyzer/analyzers/github/github.go +++ b/pkg/analyzer/analyzers/github/github.go @@ -47,10 +47,13 @@ func secretInfoToAnalyzerResult(info *common.SecretInfo) *analyzers.AnalyzerResu result.Bindings = append(result.Bindings, secretInfoToRepoBindings(info)...) result.Bindings = append(result.Bindings, secretInfoToGistBindings(info)...) for _, repo := range append(info.Repos, info.AccessibleRepos...) { - if *repo.Owner.Type != "Organization" { + if repo.Owner.GetType() != "Organization" { + continue + } + name := repo.Owner.GetName() + if name == "" { continue } - name := *repo.Owner.Name result.UnboundedResources = append(result.UnboundedResources, analyzers.Resource{ Name: name, FullyQualifiedName: fmt.Sprintf("github.com/%s", name),