nu7hatch/gouuid

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

kisielk opened this issue · 3 comments

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.

Thanks, I'll look into it.

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.

Looks like it should be enough to use io.ReadFull