tls: prevent use-after-free
authorFedor Indutny <fedor@indutny.com>
Mon, 18 May 2015 18:24:19 +0000 (20:24 +0200)
committerFedor Indutny <fedor@indutny.com>
Thu, 4 Jun 2015 21:38:26 +0000 (23:38 +0200)
commit75930bb38c734fa0f8f4dbedb4187ce61dd08e3d
tree2f86640428a82e361ee73091681943558910a701
parent5795e835a1021abdf803e1460501487adbac8d7c
tls: prevent use-after-free

* Destroy `SSL*` and friends on a next tick to make sure that we are not
  doing it in one of the OpenSSL callbacks
* Add more checks to the C++ methods that might be invoked during
  destructor's pending queue cleanup

Fix: https://github.com/joyent/node/issues/8780
Fix: https://github.com/iojs/io.js/issues/1696
PR-URL: https://github.com/nodejs/io.js/pull/1702
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
lib/_tls_wrap.js
src/tls_wrap.cc
test/parallel/test-tls-js-stream.js