Commit 743f8904 authored by Kyle Farnung's avatar Kyle Farnung
Browse files

tls: use after free in tls_wrap

The root cause is that `req_wrap` is created in `StreamBase::Write`
and passed to `TLSWrap::DoWrite`. In the TLS case the object gets
disposed and replaced with a new instance, but the caller's pointer is
never updated. When the `StreamBase::Write` method returns, it returns
a pointer to the freed object to the caller. In some cases when the
object memory has already been reused an assert is hit in
`WriteWrap::SetAllocatedStorage` because the pointer is non-null.

PR-URL: https://github.com/nodejs/node/pull/18860
Refs: https://github.com/nodejs/node/pull/18676


Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
parent a29089d7
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment