From 88bacf12a319316e440db9de8abce04ff04d5208 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 12 May 2018 21:14:44 +1000 Subject: [PATCH] #2420: Cap forge packet queue size --- .../src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java index 673497e5..0d683856 100644 --- a/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/forge/ForgeClientHandler.java @@ -1,5 +1,6 @@ package net.md_5.bungee.forge; +import com.google.common.base.Preconditions; import java.util.ArrayDeque; import java.util.Map; import lombok.AccessLevel; @@ -58,6 +59,7 @@ public class ForgeClientHandler message.setAllowExtendedPacket( true ); // FML allows extended packets so this must be enabled ForgeClientHandshakeState prevState = state; + Preconditions.checkState( packetQueue.size() < 128, "Forge packet queue too big!" ); packetQueue.add( message ); state = state.send( message, con ); if ( state != prevState ) // state finished, send packets