Skip to content

Find, verify, and analyze leaked credentials

Fix slice initialization error (#3293)

tiaoxizhan07dc95dd5815
diff --git a/pkg/analyzer/analyzers/bitbucket/bitbucket.go b/pkg/analyzer/analyzers/bitbucket/bitbucket.go
index 7b35a6f80..7bc4c5cd5 100644
--- a/pkg/analyzer/analyzers/bitbucket/bitbucket.go
+++ b/pkg/analyzer/analyzers/bitbucket/bitbucket.go
@@ -252,7 +252,7 @@ func AnalyzePermissions(cfg *config.Config, key string) (*SecretInfo, error) {
}
func convertScopeToAnalyzerPermissions(scopes []string) []analyzers.Permission {
- permissions := make([]analyzers.Permission, len(scopes))
+ permissions := make([]analyzers.Permission, 0, len(scopes))
for _, scope := range scopes {
permissions = append(permissions, analyzers.Permission{Value: scope})
}