Skip to content

Commit 77bbef8

Browse files
committed
crypto: fix randomFill with TypedArray buffer
fixes: nodejs#38137
1 parent 038608d commit 77bbef8

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/internal/crypto/random.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,9 @@ function randomFill(buf, offset, size, callback) {
155155
if (typeof offset === 'function') {
156156
callback = offset;
157157
offset = 0;
158-
size = buf.bytesLength;
159158
} else if (typeof size === 'function') {
160159
callback = size;
161-
size = buf.byteLength - offset;
160+
size = undefined;
162161
} else {
163162
validateCallback(callback);
164163
}

0 commit comments

Comments
 (0)