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

minor issue: fix remotePort validation #82

Merged

Conversation

sivukhin
Copy link
Contributor

I ran govanish linter (it still in the WIP phase) against ssh3 repo and it found a but: compiler eliminated following error check from the binary:

remotePort, err = strconv.Atoi(array[1])
if err != nil {
	return 0, nil, 0, fmt.Errorf("could not convert %s to int: %s", array[1], err)
} else if localPort > 0xFFFF {
	return 0, nil, 0, fmt.Errorf("UDP port too large %d", remotePort)
}
2023/12/25 19:08:30 it seems like your code vanished from compiled binary: func=[parseAddrPort], file=[/home/sivukhin/code/ssh3/cmd/ssh3/main.go], line=[226], snippet:
	return 0, nil, 0, fmt.Errorf("UDP port too large %d", remotePort)

This is a bug, because we need to validation remotePort value instead.

This PR fixes this minor issue.

@sivukhin sivukhin changed the title fix remotePort validation minor issue: fix remotePort validation Dec 25, 2023
@francoismichel
Copy link
Owner

Thank you ! I am currently on vacation, I'll press on the merge button once I come back.

@francoismichel francoismichel merged commit 2d88cbb into francoismichel:main Jan 2, 2024
29 checks passed
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.

None yet

2 participants