Skip to content

Commit 920c2d5

Browse files
committed
fs: harden fs.read(params, callback) typecheck
1 parent 761c078 commit 920c2d5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/fs.js

+3
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,9 @@ function read(fd, buffer, offsetOrOptions, length, position, callback) {
631631
buffer = Buffer.alloc(16384);
632632
}
633633

634+
if (params !== undefined) {
635+
validateObject(params, 'options', { nullable: true });
636+
}
634637
({
635638
offset = 0,
636639
length = buffer.byteLength - offset,

0 commit comments

Comments
 (0)