diff --git a/src/pocketmine/network/protocol/LoginPacket.php b/src/pocketmine/network/protocol/LoginPacket.php index 4d1e347b1..284591d89 100644 --- a/src/pocketmine/network/protocol/LoginPacket.php +++ b/src/pocketmine/network/protocol/LoginPacket.php @@ -41,7 +41,11 @@ class LoginPacket extends DataPacket{ public function decode(){ $this->protocol = $this->getInt(); - $str = zlib_decode($this->get($this->getInt()), 1024 * 1024 * 64); //Max 64MB + if($this->protocol !== Info::CURRENT_PROTOCOL){ + return; //Do not attempt to decode for non-accepted protocols + } + $str = zlib_decode($this->get($this->getInt()), 1024 * 1024 * 64); + $this->setBuffer($str, 0); $chainData = json_decode($this->get($this->getLInt()));