Network: Do not attempt to decode further for non-accepted protocols

Prevents 0.16 players crashing 0.15 servers
This commit is contained in:
dktapps 2016-08-30 13:26:15 +01:00 committed by Dylan K. Taylor
parent 8e9a078ff9
commit 5851e7fe55

View File

@ -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()));