Waterfall/Waterfall-Proxy-Patches/0032-Avoid-throwing-IOOB-on-login.patch

24 lines
972 B
Diff
Raw Normal View History

2023-02-23 21:51:32 +01:00
From 8a2c6364c6c2e36eaa918195ca370382a37debee 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 763d34c2..57e50a8b 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