FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fs: fix mode validation by RaisinTen · Pull Request #37432 · nodejs/node · GitHub

/ node Public

fs: fix mode validation - #37432

Closed
RaisinTen wants to merge 4 commits into
nodejs:masterfrom
RaisinTen:fs/validate-mode-in-WriteStream
Closed

fs: fix mode validation#37432
RaisinTen wants to merge 4 commits into
nodejs:masterfrom
RaisinTen:fs/validate-mode-in-WriteStream

Conversation

Copy link
Copy Markdown
Member

Fixes: #37430

nodejs-github-bot added the fs Issues and PRs related to the fs subsystem / file system. label Feb 18, 2021

Copy link
Copy Markdown
Collaborator

Linkgoron commented Feb 18, 2021
edited
Loading

Copy link
Copy Markdown
Contributor

I think that this won't work, because parseFileMode lets any uint32 number to pass it.

The error in the issue also happens in other places. For example, this also crashes:

const wat = path.join(tmpdir.path, 'wat.txt');
fs.writeFile(wat,'a123', {
  mode: 2176057344,
},(err)=>{
  console.log(err);
})

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

RaisinTen changed the title fs: validate mode in ReadStream and WriteStream fs: fix mode validation Feb 23, 2021

jasnell commented Feb 23, 2021

Copy link
Copy Markdown
Member

I'm sorry, I didn't see this PR before I opened the alternative #37480. I believe the fix in #37480 is the correct one that covers the broader case.

Copy link
Copy Markdown
Member Author

Superseded by: #37480

RaisinTen closed this Feb 24, 2021
RaisinTen deleted the fs/validate-mode-in-WriteStream branch February 24, 2021 14:00
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

Labels

fs Issues and PRs related to the fs subsystem / file system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when mode is to big in fs.createWriteStream

5 participants


Back | FazBrowse Home | New Git URL