Skip to content

Commit 821dfed

Browse files
committed
Backport pool breaking fix
1 parent 609646c commit 821dfed

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎index.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const POOL_SIZE_MULTIPLIER = 128
1111
let pool, poolOffset
1212

1313
let fillPool = bytes => {
14+
if (bytes < 0 || bytes > 1024) throw new RangeError('Wrong ID size')
1415
if (!pool || pool.length < bytes) {
1516
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)
1617
crypto.randomFillSync(pool)

0 commit comments

Comments
 (0)