From b11d3b0401639969ef726189b65916b9431e7130 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 18 May 2019 17:19:44 +0100 Subject: [PATCH] CraftingDataPacket: Fixed uncaught exception in decode this is not exploitable because it's not a serverbound packet, but it should be fixed nonetheless. --- src/pocketmine/network/mcpe/protocol/CraftingDataPacket.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/network/mcpe/protocol/CraftingDataPacket.php b/src/pocketmine/network/mcpe/protocol/CraftingDataPacket.php index f33982ed9..cfbcf8ddb 100644 --- a/src/pocketmine/network/mcpe/protocol/CraftingDataPacket.php +++ b/src/pocketmine/network/mcpe/protocol/CraftingDataPacket.php @@ -110,7 +110,11 @@ class CraftingDataPacket extends DataPacket implements ClientboundPacket{ $inputData = -1; } } - $entry["input"] = ItemFactory::get($inputId, $inputData); + try{ + $entry["input"] = ItemFactory::get($inputId, $inputData); + }catch(\InvalidArgumentException $e){ + throw new BadPacketException($e->getMessage(), 0, $e); + } $entry["output"] = $this->getSlot(); $entry["block"] = $this->getString();