Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Fixed buffer overrun in PacketizedTCP::SendList() (CVSS score: n/a) #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
6 changes: 5 additions & 1 deletion Source/PacketizedTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
#include "NativeFeatureIncludes.h"
#if _RAKNET_SUPPORT_PacketizedTCP==1 && _RAKNET_SUPPORT_TCPInterface==1

#include <algorithm> // used for std::min
#include "PacketizedTCP.h"
#include "NativeTypes.h"
#include "BitStream.h"
#include "MessageIdentifiers.h"
#include "RakAlloca.h"
#ifdef min
#undef min
#endif

using namespace RakNet;

Expand Down Expand Up @@ -96,7 +100,7 @@ bool PacketizedTCP::SendList( const char **data, const unsigned int *lengths, co
dataArray[i+1]=data[i];
lengthsArray[i+1]=lengths[i];
}
return TCPInterface::SendList(dataArray,lengthsArray,numParameters+1,systemAddress,broadcast);
return TCPInterface::SendList(dataArray, lengthsArray, std::min(numParameters, 511) + 1, systemAddress, broadcast);
}
void PacketizedTCP::PushNotificationsToQueues(void)
{
Expand Down