Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2275faa

Browse filesBrowse files
LiviaMedeirosnodejs-github-bot
authored andcommitted
fs: harden fs.read(params, callback) typecheck
PR-URL: #42772 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 29953a0 commit 2275faa
Copy full SHA for 2275faa

File tree

Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Open diff view settings
Collapse file

‎lib/fs.js‎

Copy file name to clipboardExpand all lines: lib/fs.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,9 @@ function read(fd, buffer, offsetOrOptions, length, position, callback) {
639639
buffer = Buffer.alloc(16384);
640640
}
641641

642+
if (params !== undefined) {
643+
validateObject(params, 'options', { nullable: true });
644+
}
642645
({
643646
offset = 0,
644647
length = buffer.byteLength - offset,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.