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

Fix endless loop upon large NAK ranges (CVSS score: 7.2) #127

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
4 changes: 2 additions & 2 deletions Source/ReliabilityLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,12 +817,12 @@ bool ReliabilityLayer::HandleSocketReceiveFromConnectedPlayer(
}
for (i=0; i<incomingNAKs.ranges.Size();i++)
{
if (incomingNAKs.ranges[i].minIndex>incomingNAKs.ranges[i].maxIndex)
if (incomingNAKs.ranges[i].minIndex > incomingNAKs.ranges[i].maxIndex || (incomingNAKs.ranges[i].maxIndex == (uint24_t)(0xFFFFFFFF)))
{
RakAssert(incomingNAKs.ranges[i].minIndex<=incomingNAKs.ranges[i].maxIndex);

for (unsigned int messageHandlerIndex=0; messageHandlerIndex < messageHandlerList.Size(); messageHandlerIndex++)
messageHandlerList[messageHandlerIndex]->OnReliabilityLayerNotification("incomingNAKs minIndex>maxIndex", BYTES_TO_BITS(length), systemAddress, true);
messageHandlerList[messageHandlerIndex]->OnReliabilityLayerNotification("incomingNAKs minIndex > maxIndex or maxIndex is max value", BYTES_TO_BITS(length), systemAddress, true);

return false;
}
Expand Down