tls: add CHECK for impossible condition

Backport-PR-URL: https://github.com/nodejs/node/pull/27967
PR-URL: https://github.com/nodejs/node/pull/26843
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Anna Henningsen authored and Beth Griggs committed 2019-07-16 17:38:02 +01:00
1 parent f9e8e8856a
commit 99dad28ebf
1 file changed
+4 -4
+4 -4
View File
@@ -680,10 +680,10 @@ void TLSWrap::OnStreamRead(ssize_t nread, const uv_buf_t& buf) {
return;
}
if (ssl_ == nullptr) {
EmitRead(UV_EPROTO);
return;
}
// DestroySSL() is the only thing that un-sets ssl_, but that also removes
// this TLSWrap as a stream listener, so we should not receive OnStreamRead()
// calls anymore.
CHECK(ssl_);
// Commit the amount of data actually read into the peeked/allocated buffer
// from the underlying stream.