From c9eb52ae099a3e400d914441f0e21773f7a2498e Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 23 Mar 2024 15:17:50 -0400 Subject: [PATCH] TCP: Check return value of ProtocolSocket::Open(). --- src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp b/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp index 9ea2fa0bf7..c0dd281024 100644 --- a/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp +++ b/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp @@ -1473,15 +1473,17 @@ TCPEndpoint::_Spawn(TCPEndpoint* parent, tcp_segment_header& segment, TRACE("Spawn()"); - // TODO error checking - ProtocolSocket::Open(); + // TODO: proper error handling! + if (ProtocolSocket::Open() != B_OK) { + T(Error(this, "opening failed", __LINE__)); + return DROP; + } fState = SYNCHRONIZE_RECEIVED; T(Spawn(parent, this)); fManager = parent->fManager; - // TODO: proper error handling! if (fManager->BindChild(this, buffer->destination) != B_OK) { T(Error(this, "binding failed", __LINE__)); return DROP;