mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
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:
parent
cffc14631b
commit
c0d376e242
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@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
|
||||
|
|
Loading…
Reference in a new issue