-
-
Notifications
You must be signed in to change notification settings - Fork 910
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: Test for invalid byte array sizes and ranges in v1()
, v4()
, and v7()
#845
base: main
Are you sure you want to change the base?
Conversation
maybe we shoud
|
Sorry, I missed your last comment. I've updated the PR as follows:
Note: I removed your code that silently switched to |
v1()
, v4()
, and v7()
@ctavan : Okay to push this out as a patch release? I only hesitate because this code may throw where it didn't previously. While that's not strictly a breaking API change, there's a chance it might catch some users unawares. (But those users would see obviously corrupted UUIDs currently, so it's a bit of a self-correcting problem.) It's a little surprising this hasn't come up previously. I do vaguely remember encountering this in development years ago and thinking that "undefined" appearing in a UUID string would throw for other reasons, so wasn't a concern. But that may have been before |
Check and
throw
the following conditions forv1()
,v4()
, andv7()
:options.random
oroptions.rng()
returning too-short byte arraysbuf
andoffset