mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Throw exception instead of assert on nested reliable packets
Fixes a denial of service vulnerability, issue #784
This commit is contained in:
@@ -1436,7 +1436,8 @@ SharedBuffer<u8> Connection::processPacket(Channel *channel,
|
|||||||
else if(type == TYPE_RELIABLE)
|
else if(type == TYPE_RELIABLE)
|
||||||
{
|
{
|
||||||
// Recursive reliable packets not allowed
|
// Recursive reliable packets not allowed
|
||||||
assert(reliable == false);
|
if(reliable)
|
||||||
|
throw InvalidIncomingDataException("Found nested reliable packets");
|
||||||
|
|
||||||
if(packetdata.getSize() < RELIABLE_HEADER_SIZE)
|
if(packetdata.getSize() < RELIABLE_HEADER_SIZE)
|
||||||
throw InvalidIncomingDataException
|
throw InvalidIncomingDataException
|
||||||
|
Reference in New Issue
Block a user