Files
Purpur/patches/server/0238-Fix-533-crash-exploit.patch
William Blake Galbreath 0274bd5421 Fix #533 crash exploit
2021-07-30 03:43:42 -05:00

20 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 30 Jul 2021 03:42:00 -0500
Subject: [PATCH] Fix #533 crash exploit
This fixes an exploit where a player can drop a map item with an invalid id to crash the server
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index e90193b303ecafc1073d22ff0e145a6fef42c4ce..c11f7a76576710b751a09d0a916017f732b09003 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -808,6 +808,7 @@ public abstract class Player extends LivingEntity {
// Paper start - remove player from map on drop
if (stack.getItem() == Items.FILLED_MAP) {
MapItemSavedData worldmap = MapItem.getSavedData(stack, this.level);
+ if (worldmap != null) // Purpur - fix #533
worldmap.tickCarriedBy(this, stack);
}
// Paper end