2022-10-31 17:06:55 +01:00
|
|
|
From 8c2a775eba07694db8fb29e65ddd210638ad5335 Mon Sep 17 00:00:00 2001
|
2022-03-09 18:42:33 +01:00
|
|
|
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
|
|
|
Date: Wed, 9 Mar 2022 14:36:43 -0300
|
|
|
|
Subject: [PATCH] Duplicate buf instead of Copy
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java
|
|
|
|
index 3992f521..074d2437 100644
|
|
|
|
--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java
|
|
|
|
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java
|
|
|
|
@@ -52,7 +52,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder<ByteBuf>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- ByteBuf slice = in.copy(); // Can't slice this one due to EntityMap :(
|
|
|
|
+ // FlameCord - Duplicate buf instead of Copy
|
2022-08-12 15:11:18 +02:00
|
|
|
+ ByteBuf slice = in.duplicate(); // Can't slice this one due to EntityMap :(
|
2022-03-09 18:42:33 +01:00
|
|
|
|
|
|
|
Object packetTypeInfo = null;
|
|
|
|
try
|
|
|
|
@@ -92,7 +93,8 @@ public class MinecraftDecoder extends MessageToMessageDecoder<ByteBuf>
|
|
|
|
in.skipBytes( in.readableBytes() );
|
|
|
|
}
|
|
|
|
|
|
|
|
- out.add( new PacketWrapper( packet, slice ) );
|
|
|
|
+ // FlameCord - Duplicate buf instead of Copy
|
|
|
|
+ out.add( new PacketWrapper( packet, slice.retain() ) );
|
|
|
|
slice = null;
|
|
|
|
} catch (BadPacketException | IndexOutOfBoundsException e) {
|
|
|
|
// Waterfall start: Additional DoS mitigations
|
|
|
|
--
|
2022-10-31 17:06:55 +01:00
|
|
|
2.37.3.windows.1
|
2022-03-09 18:42:33 +01:00
|
|
|
|