Skip to content

Commit 404db44

Browse files
committed
Fix Null Pointer Dereference in TCP Packet Handling
1 parent 9e671ad commit 404db44

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/transport/raw/TCP.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ CHIP_ERROR TCPBase::ProcessReceivedBuffer(Inet::TCPEndPoint * endPoint, const Pe
344344
return CHIP_NO_ERROR;
345345
}
346346
state->mReceived.Consume(kPacketSizeBytes);
347+
VerifyOrReturnError(!state->mReceived.IsNull(), CHIP_ERROR_MESSAGE_INCOMPLETE);
347348
ReturnErrorOnFailure(ProcessSingleMessage(peerAddress, state, messageSize));
348349
}
349350

0 commit comments

Comments
 (0)