{"record":{"id":"9627740aef964926","repo":"owasp-amass/amass","slug":"invalid-end-port-v","errorCode":null,"errorMessage":"invalid end port: %v","messagePattern":"invalid end port: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/scope.go","lineNumber":145,"sourceCode":"\treturn nil\n}\n\nfunc convertPortRangeToSlice(portRange string) ([]int, error) {\n\tvar ports []int\n\n\tparts := strings.Split(portRange, \"-\")\n\tif len(parts) != 2 {\n\t\treturn nil, fmt.Errorf(\"invalid port range format\")\n\t}\n\n\tstart, err := strconv.Atoi(parts[0])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid start port: %v\", err)\n\t}\n\n\tend, err := strconv.Atoi(parts[1])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid end port: %v\", err)\n\t}\n\n\tfor i := start; i <= end; i++ {\n\t\tports = append(ports, i)\n\t}\n\n\treturn ports, nil\n}\n\n// returns true is ports match default ports (80,443), otherwise return false\nfunc portCheck(ports []int) bool {\n\tdefaultPorts := []int{80, 443}\n\n\tportSet := make(map[int]struct{}, len(ports))\n\tfor _, v := range ports {\n\t\tportSet[v] = struct{}{}\n\t}\n\tif len(portSet) > len(defaultPorts) {","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/scope.go#L127-L163","documentation":"convertPortRangeToSlice could not parse the end (upper bound) of a port range such as \"80-443\": strconv.Atoi on the substring after the '-' failed because it is not a valid integer. The start bound parsed fine, so the malformed portion is specifically the second number in the range string.","triggerScenarios":"A range like '80-ninety', '80-90 ' (trailing space/newline) is passed; strconv.Atoi on parts[1] fails.","commonSituations":"Trailing whitespace or CRLF at end of a YAML value, service names in the end position, typos like '80-9O' with letter O.","solutions":["Correct the end value to a plain integer, e.g. '80-90'","Trim trailing whitespace/newlines (quote YAML values to preserve intent cleanly)","Check for letter-vs-digit typos (O vs 0, l vs 1)"],"exampleFix":"// before\nports: [\"80-9O\"]\n// after\nports: [\"80-90\"]","handlingStrategy":"validation","validationCode":"parts := strings.Split(s, \"-\"); if len(parts) == 2 { if _, err := strconv.Atoi(parts[1]); err != nil { return err } }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure the end side is a pure integer","Trim trailing whitespace/CRLF","Quote YAML values","Check digit-vs-letter typos (0/O, 1/l)"],"tags":["config","ports","parsing"],"backgroundTag":"invalid-argument-format","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}