From 1dd1025b7209bdbeb5a96ee32606b83ea7e00a66 Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Sun, 6 Sep 2026 19:20:59 +0200 Subject: [PATCH] quic: fix crash in onStreamClose onStreamClose could crash, if this[kOwner] was not set. Signed-off-by: Marten Richter --- lib/internal/quic/quic.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/quic/quic.js b/lib/internal/quic/quic.js index d55603daf1f..1a24b7f412b 100644 --- a/lib/internal/quic/quic.js +++ b/lib/internal/quic/quic.js @@ -962,9 +962,10 @@ setCallbacks({ // Called when the stream C++ handle has been closed. The error is // either undefined (clean close) or a raw array [type, code, reason] // from QuicError::ToV8Value. Convert to a proper Node.js Error. + if (!this[kOwner]) return; if (error !== undefined) { error = convertQuicError(error); - } else if (this[kOwner] && !this[kOwner].destroyed) { + } else if (!this[kOwner].destroyed) { // The stream is closing cleanly, but it may have been reset by the // peer (ReceiveStreamReset) or locally (resetStream). The C++ side // records the reset code in state.resetCode. If set, surface the