13
0
geforkt von Mirrors/Paper

Fix Varint21FrameDecoder cached length buf usage

Dieser Commit ist enthalten in:
Shane Freeder 2022-11-22 17:50:31 +00:00
Ursprung 944be7b031
Commit 3c0aa837c1

Datei anzeigen

@ -34,13 +34,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end + // Paper end
byteBuf.markReaderIndex(); byteBuf.markReaderIndex();
- byte[] bs = new byte[3];
+ // Paper start - reuse temporary length buffer + // Paper start - reuse temporary length buffer
+ byte[] abyte = lenBuf; + byte[] bs = lenBuf;
+ java.util.Arrays.fill(abyte, (byte) 0); + java.util.Arrays.fill(bs, (byte) 0);
+ // Paper end + // Paper end
byte[] bs = new byte[3];
for(int i = 0; i < bs.length; ++i) { for(int i = 0; i < bs.length; ++i) {
if (!byteBuf.isReadable()) {
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java --- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java