mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
RegionLocationTableEntry: cap firstSector at 16777216
this is the biggest sector start that the location table can represent, due to the binary format. Larger values than this will overflow and cause corruption. This provides an effective limit of 64 GB on region files.
This commit is contained in:
parent
d38709a7ae
commit
bb2685ca65
@ -38,7 +38,7 @@ class RegionLocationTableEntry{
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function __construct(int $firstSector, int $sectorCount, int $timestamp){
|
||||
if($firstSector < 0){
|
||||
if($firstSector < 0 or $firstSector >= 2 ** 24){
|
||||
throw new \InvalidArgumentException("Start sector must be positive, got $firstSector");
|
||||
}
|
||||
$this->firstSector = $firstSector;
|
||||
|
Loading…
x
Reference in New Issue
Block a user