Uh oh!
There was an error while loading. Please reload this page.
fs: validate the input data before opening file - #31731
Closed
ZYSzys wants to merge 2 commits into
Closed
Conversation
nodejs-github-bot
commented
Feb 11, 2020
Collaborator
BridgeAR
approved these changes
Feb 11, 2020
BridgeAR
left a comment
Member
There was a problem hiding this comment.
Thanks, this slipped through! LGTM % comment
Uh oh!
There was an error while loading. Please reload this page.
cjihrig
approved these changes
Feb 11, 2020
lpinca
approved these changes
Feb 11, 2020
addaleax
approved these changes
Feb 11, 2020
nodejs-github-bot
commented
Feb 11, 2020
Collaborator
lundibundi
approved these changes
Feb 12, 2020
ZYSzys
commented
Feb 13, 2020
MemberAuthor
Landed in 3e9302b. |
codebytere
commented
Feb 17, 2020
Member
@lundibundi should this be backported to v13.x? it'll need a manual if yes. |
lundibundi
commented
Feb 18, 2020
Member
/cc @ZYSzys ^ |
ZYSzys
commented
Feb 19, 2020
MemberAuthor
I think no, since this fixed the bug caused by #31030 (which is |
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 freeto 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.
Now running
python tools/test.py test/parallel/test-fs-append-filein our master branch, there was a file calledfoobargenerated, which was caused by this line:node/test/parallel/test-fs-append-file.js
Line 143 in fb437c4
This was because firstly we opened
foobarfile and then validating the input data in ourfs.promisemodule.So I think the more reasonable method is validating the input data first and then opening the file, to be consistent with
fsmodule.Refs: #31030
/cc @BridgeAR
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes