From f55f60d1bc5d14a211a338dd1bf1d7663fa76786 Mon Sep 17 00:00:00 2001 From: Luke1410 Date: Sat, 2 Jun 2018 12:58:20 +0200 Subject: [PATCH] - fix endless loop upon large NAK ranges (fixes part of #32) --- Source/ReliabilityLayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/ReliabilityLayer.cpp b/Source/ReliabilityLayer.cpp index dbeb17b94..022952bbd 100644 --- a/Source/ReliabilityLayer.cpp +++ b/Source/ReliabilityLayer.cpp @@ -817,12 +817,12 @@ bool ReliabilityLayer::HandleSocketReceiveFromConnectedPlayer( } for (i=0; iincomingNAKs.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; }