Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Issue - 3697 - GitHub analyzer panic (#4113)
Amaan Ullah87a80345c421
diff --git a/pkg/analyzer/analyzers/github/common/github.go b/pkg/analyzer/analyzers/github/common/github.goindex bde4acc07..1804e4a3f 100644--- a/pkg/analyzer/analyzers/github/common/github.go+++ b/pkg/analyzer/analyzers/github/common/github.go@@ -176,12 +176,20 @@ func PrintGists(gists []*gh.Gist, showAll bool) {t.SetOutputMirror(os.Stdout)t.AppendHeader(table.Row{"Gist ID", "Gist Link", "Description", "Private"})for _, gist := range gists {- if showAll && *gist.Public {- t.AppendRow([]interface{}{*gist.ID, *gist.HTMLURL, *gist.Description, "false"})- } else if !*gist.Public {+ if gist == nil {+ continue+ }+ gistID := gist.GetID()+ gistLink := gist.GetHTMLURL()+ gistDescription := gist.GetDescription()+ isPublic := gist.GetPublic()++ if showAll && isPublic {+ t.AppendRow([]any{gistID, gistLink, gistDescription, "false"})+ } else if !isPublic {privateCount++green := color.New(color.FgGreen).SprintFunc()- t.AppendRow([]interface{}{green(*gist.ID), green(*gist.HTMLURL), green(*gist.Description), green("true")})+ t.AppendRow([]any{green(gistID), green(gistLink), green(gistDescription), green("true")})}}if showAll && len(gists) == 0 {