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

fix : add port error bounds to encodePeer #260

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

Conversation

gauravsaini
Copy link

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[x] Bug fix
[ ] New feature
[ ] Other, please explain:

What changes did you make? (Give an overview)
Fix encodePeer to add port range bounds to it
Which issue (if any) does this pull request address?

Is there anything you'd like reviewers to focus on?

@welcome
Copy link

welcome bot commented Dec 2, 2022

🙌 Thanks for opening this pull request! You're awesome.

@gauravsaini gauravsaini marked this pull request as ready for review December 2, 2022 05:57
const ip = host.split('.')
for (let i = 0; i < 4; i++) buf[i] = parseInt(ip[i] || 0, 10)
function encodePeer(host, port) {
const buf = Buffer.alloc(6)
Copy link
Contributor

Choose a reason for hiding this comment

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

This does have a minor logic change in that this will initialize a 0 filled Buffer. I do not know enough about this project to say if that matters.

@0awful
Copy link
Contributor

0awful commented Aug 12, 2023

Minus the one thing I called out these changes look good to me.

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