NewV4() should check number of bytes returned from rand.Read
kisielk opened this issue · 3 comments
kisielk commented
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 commented
Thanks, I'll look into it.
ZackPierce commented
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 commented
Looks like it should be enough to use io.ReadFull