Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add port validator to ensure configurable ports are valid #7037

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

luolanzone
Copy link
Contributor

@luolanzone luolanzone commented Mar 2, 2025

Resolves #7035

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these all the port numbers we want to validate? what about tunnelPort (we mentioned it in the issue)?

also you are not referencing issue #7035

@@ -79,3 +79,11 @@ func parsePortRange(portRangeStr string) (start, end int, err error) {

return start, end, nil
}

// isValidPort checks if the given port number is within the valid range of 1 to 65535.
func isValidPort(port int) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't need to be "exported"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not required at the moment, but I will go through and double check if I missed any port beside tunnelPort. I have updated the changes for tunnelPort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate all configurable network ports to avoid invalid port
2 participants