-
-
Notifications
You must be signed in to change notification settings - Fork 938
Closed
Labels
Description
Description of the problem
Reporting on behalf of @gaoyia
Recipe for reproducing
import { stringify, v4 } from 'uuid';
const buf = new Uint8Array(16);
v4({}, buf, -8); // Invalid offset should throw, but doesn't
console.log(buf); // Uint8Array(16) [... (8 bytes), 0, 0, 0, 0, 0, 0, 0, 0]
stringify(buf); // Throws!
Similarly...
const buf = new Uint8Array(15); // Note: 15 bytes, not 16
v4({}, buf); // Invalid buf size should throw, but doesn't
console.log(buf); // [... 15 bytes ...]
stringify(buf); // Throws!
Additional information
No response
Environment
No response