Skip to content

Commit

Permalink
Fix GitHub analyzer panic on empty organization name (#3295)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcastorina committed Sep 13, 2024
1 parent 07dc95d commit 213bf7e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/analyzer/analyzers/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 213bf7e

Please sign in to comment.