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 4356836

Browse filesBrowse files
cjihrigtargos
authored andcommitted
fs: validate writev fds consistently
This commit updates the recently added writev methods to validate file descriptors like the other fs methods do. PR-URL: #29185 Refs: #25925 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent acdc21b commit 4356836
Copy full SHA for 4356836

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎lib/fs.js‎

Copy file name to clipboardExpand all lines: lib/fs.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ function writev(fd, buffers, position, callback) {
609609
callback(err, written || 0, buffers);
610610
}
611611

612-
validateUint32(fd, 'fd');
612+
validateInt32(fd, 'fd', 0);
613613

614614
if (!isBuffersArray(buffers)) {
615615
throw new ERR_INVALID_ARG_TYPE('buffers', 'ArrayBufferView[]', buffers);
@@ -634,7 +634,7 @@ Object.defineProperty(writev, internalUtil.customPromisifyArgs, {
634634
// fs.writevSync(fd, buffers[, position]);
635635
function writevSync(fd, buffers, position) {
636636

637-
validateUint32(fd, 'fd');
637+
validateInt32(fd, 'fd', 0);
638638
const ctx = {};
639639

640640
if (!isBuffersArray(buffers)) {

0 commit comments

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