fix: #210 Stack for saving decoded buffer overflow

This commit is contained in:
yuanyuanxiang
2025-10-22 02:57:24 +08:00
parent 11a77fda06
commit b0f622b9c4
10 changed files with 26 additions and 19 deletions

View File

@@ -122,11 +122,11 @@ void IOCPUDPServer::WorkerThread()
m_hThread = NULL;
}
VOID IOCPUDPServer::Send2Client(CONTEXT_OBJECT* ContextObject, PBYTE szBuffer, ULONG ulOriginalLength)
BOOL IOCPUDPServer::Send2Client(CONTEXT_OBJECT* ContextObject, PBYTE szBuffer, ULONG ulOriginalLength)
{
ContextObject->OutCompressedBuffer.ClearBuffer();
if (!WriteContextData(ContextObject, szBuffer, ulOriginalLength))
return;
return FALSE;
WSABUF buf = {
ContextObject->OutCompressedBuffer.GetBufferLength(),
(CHAR*)ContextObject->OutCompressedBuffer.GetBuffer(),
@@ -150,7 +150,9 @@ VOID IOCPUDPServer::Send2Client(CONTEXT_OBJECT* ContextObject, PBYTE szBuffer, U
if (err == SOCKET_ERROR) {
DWORD err = WSAGetLastError();
Mprintf("[IOCP] Send2Client error: %d\n", err);
return FALSE;
}
return TRUE;
}
VOID IOCPUDPServer::Destroy()