aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2013-07-04 06:18:50 +0200
committerKahrl <kahrl@gmx.net>2013-07-04 06:18:50 +0200
commita013f762c4c9b39a1d143ee1b68e6d8e86dcee22 (patch)
tree928330126fd3150faa1e7e41e5dc60d66173d650
parent3f6f327cb97662eb95e20f62650abcfac6bce3ab (diff)
downloadminetest-a013f762c4c9b39a1d143ee1b68e6d8e86dcee22.tar.gz
minetest-a013f762c4c9b39a1d143ee1b68e6d8e86dcee22.tar.bz2
minetest-a013f762c4c9b39a1d143ee1b68e6d8e86dcee22.zip
Throw exception instead of assert on nested reliable packets
Fixes a denial of service vulnerability, issue #784
-rw-r--r--src/connection.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/connection.cpp b/src/connection.cpp
index b94df5e82..dd7ff597b 100644
--- a/src/connection.cpp
+++ b/src/connection.cpp
@@ -1436,7 +1436,8 @@ SharedBuffer<u8> Connection::processPacket(Channel *channel,
else if(type == TYPE_RELIABLE)
{
// Recursive reliable packets not allowed
- assert(reliable == false);
+ if(reliable)
+ throw InvalidIncomingDataException("Found nested reliable packets");
if(packetdata.getSize() < RELIABLE_HEADER_SIZE)
throw InvalidIncomingDataException