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: copyPeersFromList may cause peerArr be empty #29

Merged
merged 1 commit into from
Apr 8, 2019

Conversation

monotone
Copy link
Contributor

@monotone monotone commented Apr 8, 2019

the builtin function copy will use the minimum of len(src) and len(dst). so this code use zero length for newArr will not copy the peerArr content.

the `copy` function will use  the minimum of len(src) and len(dst)
@anacrolix
Copy link
Contributor

Good catch, thanks. It looks like there's a lot more to be improved here still too.

@anacrolix anacrolix merged commit 697cb69 into libp2p:master Apr 8, 2019
@monotone
Copy link
Contributor Author

monotone commented Apr 9, 2019

I found this when i resolve some issues from ipfs. So is there a need to make a issue for ipfs?

@Stebalien
Copy link
Member

Wow. (sorry)

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.

3 participants