From 0274bd54211349ff249eda1dd8ee16432a71293c Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Fri, 30 Jul 2021 03:43:42 -0500 Subject: [PATCH] Fix #533 crash exploit --- .../server/0238-Fix-533-crash-exploit.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 patches/server/0238-Fix-533-crash-exploit.patch diff --git a/patches/server/0238-Fix-533-crash-exploit.patch b/patches/server/0238-Fix-533-crash-exploit.patch new file mode 100644 index 000000000..beb26d24b --- /dev/null +++ b/patches/server/0238-Fix-533-crash-exploit.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath +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