mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
fs: harden fs.read(params, callback) typecheck
PR-URL: https://github.com/nodejs/node/pull/42772 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
29953a0b88
commit
2275faac2b
1 changed files with 3 additions and 0 deletions
|
@ -639,6 +639,9 @@ function read(fd, buffer, offsetOrOptions, length, position, callback) {
|
|||
buffer = Buffer.alloc(16384);
|
||||
}
|
||||
|
||||
if (params !== undefined) {
|
||||
validateObject(params, 'options', { nullable: true });
|
||||
}
|
||||
({
|
||||
offset = 0,
|
||||
length = buffer.byteLength - offset,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue