summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortycho <work.tycho@gmail.com>2015-12-17 23:34:19 +0100
committerMattes D <github@xoft.cz>2015-12-18 15:20:24 +0100
commit456253c651a7230e1d8217969344894d876ad05a (patch)
tree44d45134caab888386e5fa7ba2935ac197eb3ed8
parentMerge pull request #2759 from cuberite/ExplosionAPI (diff)
downloadcuberite-456253c651a7230e1d8217969344894d876ad05a.tar
cuberite-456253c651a7230e1d8217969344894d876ad05a.tar.gz
cuberite-456253c651a7230e1d8217969344894d876ad05a.tar.bz2
cuberite-456253c651a7230e1d8217969344894d876ad05a.tar.lz
cuberite-456253c651a7230e1d8217969344894d876ad05a.tar.xz
cuberite-456253c651a7230e1d8217969344894d876ad05a.tar.zst
cuberite-456253c651a7230e1d8217969344894d876ad05a.zip
-rw-r--r--src/WorldStorage/FastNBT.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/WorldStorage/FastNBT.cpp b/src/WorldStorage/FastNBT.cpp
index 70570f7d0..a90db2b71 100644
--- a/src/WorldStorage/FastNBT.cpp
+++ b/src/WorldStorage/FastNBT.cpp
@@ -110,7 +110,12 @@ bool cParsedNBT::ReadCompound(void)
for (;;)
{
NEEDBYTES(1);
- eTagType TagType = static_cast<eTagType>(m_Data[m_Pos]);
+ const char TagTypeNum = m_Data[m_Pos];
+ if ((TagTypeNum < TAG_Min) || (TagTypeNum > TAG_Max))
+ {
+ return false;
+ }
+ eTagType TagType = static_cast<eTagType>(TagTypeNum);
m_Pos++;
if (TagType == TAG_End)
{
@@ -258,7 +263,6 @@ bool cParsedNBT::ReadTag(void)
#endif
case TAG_Min:
{
- ASSERT(!"Unhandled NBT tag type");
return false;
}
} // switch (iType)