aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2023-06-16 10:27:59 -0700
committerSpottedleaf <[email protected]>2023-06-16 10:27:59 -0700
commita226f44b452c8c75ca077b492ba4a957629ba489 (patch)
tree07acd3786c48804e83b1b5ea4f78910d1368409f
parentf5551380b3279bf51752e8617e384a594ac1a2f5 (diff)
downloadPaper-a226f44b452c8c75ca077b492ba4a957629ba489.tar.gz
Paper-a226f44b452c8c75ca077b492ba4a957629ba489.zip
Copy itemstack when sanitizing for datawatcher items
Since the packet is broadcasted for players, it means that the packet will be sent to multiple players. In this case, modifying the data results in a possible race condition where a CME may occur as the packet will be serialized on many different netty IO threads.
-rw-r--r--patches/server/0736-Prevent-sending-oversized-item-data-in-equipment-and.patch4
1 files changed, 2 insertions, 2 deletions
diff --git a/patches/server/0736-Prevent-sending-oversized-item-data-in-equipment-and.patch b/patches/server/0736-Prevent-sending-oversized-item-data-in-equipment-and.patch
index 92abda7e55..1001f67b5d 100644
--- a/patches/server/0736-Prevent-sending-oversized-item-data-in-equipment-and.patch
+++ b/patches/server/0736-Prevent-sending-oversized-item-data-in-equipment-and.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Prevent sending oversized item data in equipment and metadata
diff --git a/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java b/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java
-index 97da8896865ff0bdd4fe8f2155b0830b42051bb1..17d0519ce3c097a38f9867fff3e1c25eb7febb59 100644
+index 97da8896865ff0bdd4fe8f2155b0830b42051bb1..9ca897d92c5bdd2764d114c74d64c776674d6beb 100644
--- a/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java
+++ b/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java
@@ -42,7 +42,7 @@ public class EntityDataSerializers {
@@ -13,7 +13,7 @@ index 97da8896865ff0bdd4fe8f2155b0830b42051bb1..17d0519ce3c097a38f9867fff3e1c25e
@Override
public void write(FriendlyByteBuf buf, ItemStack value) {
- buf.writeItem(value);
-+ buf.writeItem(net.minecraft.world.entity.LivingEntity.sanitizeItemStack(value, false)); // Paper - prevent oversized data
++ buf.writeItem(net.minecraft.world.entity.LivingEntity.sanitizeItemStack(value, true)); // Paper - prevent oversized data
}
@Override