mirror of
https://github.com/zebrajr/node.git
synced 2025-12-07 00:20:38 +01: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
|
|
@ -639,6 +639,9 @@ function read(fd, buffer, offsetOrOptions, length, position, callback) {
|
||||||
buffer = Buffer.alloc(16384);
|
buffer = Buffer.alloc(16384);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params !== undefined) {
|
||||||
|
validateObject(params, 'options', { nullable: true });
|
||||||
|
}
|
||||||
({
|
({
|
||||||
offset = 0,
|
offset = 0,
|
||||||
length = buffer.byteLength - offset,
|
length = buffer.byteLength - offset,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user