Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/perf/lib/Tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,10 @@ bool TcpConnection::ProcessReceiveData(const uint8_t* Buffer, uint32_t BufferLen

auto Frame = (TcpFrame*)BufferedData;
Comment thread
gaurav2699 marked this conversation as resolved.
auto FrameLength = (uint32_t)sizeof(TcpFrame) + Frame->Length + CXPLAT_ENCRYPTION_OVERHEAD;
Comment thread
gaurav2699 marked this conversation as resolved.
Outdated
if (FrameLength > sizeof(BufferedData)) {
WriteOutput("Invalid frame length\n");
Comment thread
gaurav2699 marked this conversation as resolved.
Outdated
return false;
}
auto BytesNeeded = FrameLength - BufferedDataLength;
if (BufferLength < BytesNeeded) {
goto BufferData;
Expand Down Expand Up @@ -895,6 +899,10 @@ bool TcpConnection::ProcessReceiveData(const uint8_t* Buffer, uint32_t BufferLen

BufferData:

if (BufferedDataLength + BufferLength > sizeof(BufferedData)) {
Comment thread
gaurav2699 marked this conversation as resolved.
WriteOutput("Invalid frame length\n");
return false;
}
CxPlatCopyMemory(BufferedData+BufferedDataLength, Buffer, BufferLength);
BufferedDataLength += BufferLength;

Expand Down
Loading