Fix GitHub analyzer panic on empty organization name (#3295)

This commit is contained in:
Miccah 2024-09-13 11:31:31 -07:00 committed by GitHub
parent 07dc95dd58
commit 213bf7e4fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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),