diff options
author | Mattes D <github@xoft.cz> | 2014-05-09 21:20:27 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-05-09 21:20:27 +0200 |
commit | a38d8b6513215a542cc0d450f95c90291b699d8e (patch) | |
tree | 132dcfa19bf05d92f0e04c622f4ae54f03f7e029 /src/WorldStorage/MapSerializer.cpp | |
parent | Fixed size_t in FireworksSerializer. (diff) | |
parent | Range Check on schematic size (diff) | |
download | cuberite-a38d8b6513215a542cc0d450f95c90291b699d8e.tar cuberite-a38d8b6513215a542cc0d450f95c90291b699d8e.tar.gz cuberite-a38d8b6513215a542cc0d450f95c90291b699d8e.tar.bz2 cuberite-a38d8b6513215a542cc0d450f95c90291b699d8e.tar.lz cuberite-a38d8b6513215a542cc0d450f95c90291b699d8e.tar.xz cuberite-a38d8b6513215a542cc0d450f95c90291b699d8e.tar.zst cuberite-a38d8b6513215a542cc0d450f95c90291b699d8e.zip |
Diffstat (limited to 'src/WorldStorage/MapSerializer.cpp')
-rw-r--r-- | src/WorldStorage/MapSerializer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/WorldStorage/MapSerializer.cpp b/src/WorldStorage/MapSerializer.cpp index df72d1cc9..012fc52f3 100644 --- a/src/WorldStorage/MapSerializer.cpp +++ b/src/WorldStorage/MapSerializer.cpp @@ -152,6 +152,10 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT) if (CurrLine >= 0) { unsigned int Width = a_NBT.GetShort(CurrLine); + if (Width != 128) + { + return false; + } m_Map->m_Width = Width; } @@ -159,6 +163,10 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT) if (CurrLine >= 0) { unsigned int Height = a_NBT.GetShort(CurrLine); + if (Height >= 256) + { + return false; + } m_Map->m_Height = Height; } |