mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-01 00:10:32 +01:00
25 lines
1.4 KiB
Diff
25 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
Date: Sat, 7 May 2022 14:58:53 -0700
|
|
Subject: [PATCH] Do not accept invalid client settings
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
index 0545c7fb227665dd23c7b5034a1520ed10f962b9..901fa17d0f0a3f66923f68f13f183bc4c17f7748 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
@@ -3170,6 +3170,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
|
@Override
|
|
public void handleClientInformation(ServerboundClientInformationPacket packet) {
|
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
|
+ // Paper start - do not accept invalid information
|
|
+ if (packet.viewDistance() < 0) {
|
|
+ LOGGER.warn("Disconnecting " + this.player.getScoreboardName() + " for invalid view distance: " + packet.viewDistance());
|
|
+ this.disconnect("Invalid client settings", PlayerKickEvent.Cause.ILLEGAL_ACTION);
|
|
+ return;
|
|
+ }
|
|
+ // Paper end - do not accept invalid information
|
|
this.player.updateOptions(packet);
|
|
}
|
|
|