From 9180140231823f8a9cd6c6d7cf05d809d76299f2 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Sun, 7 Jun 2015 00:37:35 +0200 Subject: _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 --- src/js_stream.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/js_stream.cc') diff --git a/src/js_stream.cc b/src/js_stream.cc index 6b7c4063e0..91041d0201 100644 --- a/src/js_stream.cc +++ b/src/js_stream.cc @@ -163,7 +163,7 @@ template void JSStream::Finish(const FunctionCallbackInfo& args) { Wrap* w = Unwrap(args[0].As()); - w->Done(args[0]->Int32Value()); + w->Done(args[1]->Int32Value()); } -- cgit v1.2.3