fs: fix file descriptor validator#49752
Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom Sep 24, 2023
Merged
Conversation
bnoordhuis
approved these changes
Sep 22, 2023
Member
bnoordhuis
left a comment
There was a problem hiding this comment.
One additional step you could take is this (pseudo-ish code):
if (isFd(fd)) validateInteger(fd, 'options.fd', 0, kMaxInt32);While passing ex. -1 or -42 to libuv is Mostly Harmless (should fail with UV_EBADF) it's probably best to turn what is currently a runtime error into a validation error. That might make it semver-major though.
(And I vote to rename kMaxInt to kMaxUint32 because I find the former highly misleading.)
lpinca
approved these changes
Sep 22, 2023
Member
Author
|
@bnoordhuis I'll follow up with a different pull request |
394e7e0 to
fa56769
Compare
Member
Author
|
@lpinca @bnoordhuis I had to force-push to rebase. Can you re-review? |
bnoordhuis
approved these changes
Sep 22, 2023
Collaborator
Collaborator
20 tasks
Collaborator
Collaborator
|
Landed in 5d6aa85 |
21 tasks
ruyadorno
pushed a commit
that referenced
this pull request
Sep 28, 2023
PR-URL: #49752 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
alexfernandez
pushed a commit
to alexfernandez/node
that referenced
this pull request
Nov 1, 2023
PR-URL: nodejs#49752 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref #49691 (comment) by @bnoordhuis