mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Check if the specified length is correct
This commit is contained in:
parent
5c1550e116
commit
8739017002
@ -182,6 +182,10 @@ class RakNetParser{
|
||||
return false;
|
||||
}else{
|
||||
$pid = $this->getByte();
|
||||
$buffer = $this->get($length - 1);
|
||||
if(strlen($buffer) < ($length - 1)){
|
||||
return false;
|
||||
}
|
||||
if(isset(ProtocolInfo::$packets[$pid])){
|
||||
$data = new ProtocolInfo::$packets[$pid];
|
||||
}else{
|
||||
@ -196,7 +200,7 @@ class RakNetParser{
|
||||
$data->splitCount = $splitCount;
|
||||
$data->splitID = $splitID;
|
||||
$data->splitIndex = $splitIndex;
|
||||
$data->setBuffer($this->get($length - 1));
|
||||
$data->setBuffer($buffer);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user