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

NewV4() should check number of bytes returned from rand.Read #8

Open
kisielk opened this issue Aug 9, 2013 · 3 comments
Open

NewV4() should check number of bytes returned from rand.Read #8

kisielk opened this issue Aug 9, 2013 · 3 comments

Comments

@kisielk
Copy link
Contributor

kisielk commented Aug 9, 2013

Conceivably rand.Read could return fewer than the requested number of bytes and still not return an error. This would result in the trailing bytes of the UUID being 0 and no error reported.

@nu7hatch
Copy link
Owner

nu7hatch commented Oct 3, 2013

Thanks, I'll look into it.

@ZackPierce
Copy link

This issue should be handled by Go 1.2, as noted in this bug ticket. It may still be worthwhile to correct here to help out people that may or may not be moving to Go 1.2 in a close time period.

@kisielk
Copy link
Contributor Author

kisielk commented Oct 5, 2013

Looks like it should be enough to use io.ReadFull

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

3 participants