Skip to content
Open
Changes from all commits
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
fix(epoll): buffer overflow when GSO off
  • Loading branch information
qzhuyan committed Dec 19, 2024
commit 9261dacc1dd9a67f6fa8d5fbe663082508b4c605
3 changes: 2 additions & 1 deletion src/platform/datapath_epoll.c
Original file line number Diff line number Diff line change
@@ -2154,7 +2154,8 @@ CxPlatSendDataFinalizeSendBuffer(
struct iovec* IoVec = &SendData->Iovs[SendData->BufferCount - 1];
IoVec->iov_base = SendData->ClientBuffer.Buffer;
IoVec->iov_len = SendData->ClientBuffer.Length;
if (SendData->TotalSize + SendData->SegmentSize > sizeof(SendData->Buffer) ||
if (SendData->SegmentSize == 0 ||
SendData->TotalSize + SendData->SegmentSize > sizeof(SendData->Buffer) ||
SendData->BufferCount == SendData->SocketContext->DatapathPartition->Datapath->SendIoVecCount) {
SendData->ClientBuffer.Buffer = NULL;
} else {
Loading
Oops, something went wrong.