Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs: validate fd on fs.write #1553

Closed
wants to merge 1 commit into from
Closed

fs: validate fd on fs.write #1553

wants to merge 1 commit into from

Conversation

julianduque
Copy link
Contributor

This PR fixes #1550

@mscdex mscdex added the fs Issues and PRs related to the fs subsystem / file system. label Apr 28, 2015
@@ -779,6 +779,9 @@ static void Open(const FunctionCallbackInfo<Value>& args) {
static void WriteBuffer(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);

if (!args[0]->IsInt32())
return env->ThrowTypeError("First argument must be file descriptor");

CHECK(args[0]->IsInt32());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this check still required?

@julianduque
Copy link
Contributor Author

@cjihrig fixed PR with your suggestions

@cjihrig
Copy link
Contributor

cjihrig commented Apr 28, 2015

LGTM

julianduque added a commit that referenced this pull request Apr 28, 2015
PR-URL: #1553
Reviewed-By: Colin Ihrig <[email protected]>
@julianduque
Copy link
Contributor Author

Landed in f9c681c

@julianduque julianduque deleted the fix-fs-write branch April 28, 2015 22:47
@rvagg rvagg mentioned this pull request Apr 29, 2015
Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request Apr 29, 2015
Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request May 14, 2015
PR-URL: nodejs#1553
PORT-PR-URL: nodejs#1560
PORT-FROM: v2.x / f9c681c
Reviewed-By: Colin Ihrig <[email protected]>
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.

fs.write crashes on non-integer fd
3 participants