Waterfall/Waterfall-Proxy-Patches/0034-Avoid-throwing-IOOB-on-login.patch
2022-10-31 17:06:55 +01:00

24 lines
972 B
Diff

From 0eb7dd9c239bb09fa8b87ad963b2203ea6f9e2eb Mon Sep 17 00:00:00 2001
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
Date: Tue, 13 Sep 2022 20:41:48 -0300
Subject: [PATCH] Avoid throwing IOOB on login
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java
index 22a5b993..78a2d569 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginRequest.java
@@ -32,7 +32,8 @@ public class LoginRequest extends DefinedPacket
}
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_1 )
{
- if ( buf.readBoolean() )
+ // FlameCord - Avoid throwing IOOB on login
+ if ( buf.isReadable() && buf.readBoolean() )
{
uuid = readUUID( buf );
}
--
2.37.3.windows.1