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.
This commit is contained in:
@@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@Override
|
@Override
|
||||||
public void write(FriendlyByteBuf buf, ItemStack value) {
|
public void write(FriendlyByteBuf buf, ItemStack value) {
|
||||||
- buf.writeItem(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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user