diff options
author | Fedor Indutny <fedor@indutny.com> | 2015-06-07 01:37:35 +0300 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2015-07-01 06:09:22 +0300 |
commit | 9180140231823f8a9cd6c6d7cf05d809d76299f2 (patch) | |
tree | 1fe4ff09763d4b8b5470dd28ff57aaf9008d6218 /src/js_stream.cc | |
parent | 6c61ca5325a411c4b64177c5bca58030ea5b97a4 (diff) |
_stream_wrap: prevent use after free in TLS
Queued write requests should be invoked on handle close, otherwise the
"consumer" might be already destroyed when the write callbacks of the
"consumed" handle will be invoked. Same applies to the shutdown
requests.
Make sure to "move" away socket from server to not break the
`connections` counter in `net.js`. Otherwise it might not call `close`
callback, or call it too early.
Fix: https://github.com/iojs/io.js/issues/1696
PR-URL: https://github.com/nodejs/io.js/pull/1910
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'src/js_stream.cc')
-rw-r--r-- | src/js_stream.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js_stream.cc b/src/js_stream.cc index 6b7c4063e05..91041d02011 100644 --- a/src/js_stream.cc +++ b/src/js_stream.cc @@ -163,7 +163,7 @@ template <class Wrap> void JSStream::Finish(const FunctionCallbackInfo<Value>& args) { Wrap* w = Unwrap<Wrap>(args[0].As<Object>()); - w->Done(args[0]->Int32Value()); + w->Done(args[1]->Int32Value()); } |