Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion pkg/parser/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ func EnsureLocalhostDomains(domains []string) []string {
}
}

result := make([]string, 0, len(domains)+4)
// CWE-190: Allocation Size Overflow Prevention
// Instead of pre-calculating capacity (len(domains)+4), which could overflow
// if domains is extremely large, we let Go's append handle capacity growth
// automatically. This is safe and efficient for domain arrays which are
// typically small in practice.
var result []string

// Always add localhost domains first (with and without port specifications)
if !hasLocalhost {
Expand Down
Loading