Throw exception instead of assert on nested reliable packets
authorKahrl <kahrl@gmx.net>
Thu, 4 Jul 2013 04:18:50 +0000 (06:18 +0200)
committerKahrl <kahrl@gmx.net>
Thu, 4 Jul 2013 04:18:50 +0000 (06:18 +0200)
Fixes a denial of service vulnerability, issue #784

src/connection.cpp

index b94df5e82824e5a286990fd5c1ddeb7bdf3bbfd3..dd7ff597bea7686862fc2692c62c9b5e67c32994 100644 (file)
@@ -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