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

validateInfo in misc.go is offbyone #35

Closed
soul9 opened this issue Oct 27, 2015 · 3 comments
Closed

validateInfo in misc.go is offbyone #35

soul9 opened this issue Oct 27, 2015 · 3 comments

Comments

@soul9
Copy link

soul9 commented Oct 27, 2015

ValidateInfo should work perfectly fine except for a -1 that slipped in the length sanity verification somehow here https://github.com/anacrolix/torrent/blob/master/misc.go#L119

soul9 added a commit to soul9/torrent that referenced this issue Oct 27, 2015
@anacrolix
Copy link
Owner

That's for rounding up integer division. Do you have an example or test case for broken behaviour you're experiencing?

@soul9
Copy link
Author

soul9 commented Oct 28, 2015

sure, here is the testcase
https://gist.github.com/soul9/b2e8cdd3f069222d0e65

@anacrolix
Copy link
Owner

Thanks for that. The error is actually in the builder code, which I incorporated from another project. metainfo/builder.go:307. I'll issue a fix soon.

anacrolix added a commit that referenced this issue Apr 30, 2016
Builder is poorly designed, and issue #35 is poorly written. I don't want to support either of them.
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

No branches or pull requests

2 participants