NetworkBinaryStream: fix server crash on wrong skindata size, close #3276

This commit is contained in:
Dylan K. Taylor 2020-01-15 19:48:25 +00:00
parent a4b810977a
commit 00869e81ba

View File

@ -148,7 +148,11 @@ class NetworkBinaryStream extends BinaryStream{
$width = $this->getLInt();
$height = $this->getLInt();
$data = $this->getString();
return new SkinImage($height, $width, $data);
try{
return new SkinImage($height, $width, $data);
}catch(\InvalidArgumentException $e){
throw new BadPacketException($e->getMessage(), 0, $e);
}
}
private function putSkinImage(SkinImage $image) : void{