summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-12-18 12:24:05 +0100
committerMattes D <github@xoft.cz>2015-12-18 12:24:05 +0100
commitc8de191e4dcaffb9c704ca2756d0c2664759de8a (patch)
tree3c5d2390c152773bc04e34617f59e5f50c00ef31
parentMerge pull request #2755 from cuberite/coverage (diff)
parentFixed String Parsing crash bug (diff)
downloadcuberite-c8de191e4dcaffb9c704ca2756d0c2664759de8a.tar
cuberite-c8de191e4dcaffb9c704ca2756d0c2664759de8a.tar.gz
cuberite-c8de191e4dcaffb9c704ca2756d0c2664759de8a.tar.bz2
cuberite-c8de191e4dcaffb9c704ca2756d0c2664759de8a.tar.lz
cuberite-c8de191e4dcaffb9c704ca2756d0c2664759de8a.tar.xz
cuberite-c8de191e4dcaffb9c704ca2756d0c2664759de8a.tar.zst
cuberite-c8de191e4dcaffb9c704ca2756d0c2664759de8a.zip
-rw-r--r--src/WorldStorage/FastNBT.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/WorldStorage/FastNBT.cpp b/src/WorldStorage/FastNBT.cpp
index 35c3ace0b..70570f7d0 100644
--- a/src/WorldStorage/FastNBT.cpp
+++ b/src/WorldStorage/FastNBT.cpp
@@ -91,11 +91,7 @@ bool cParsedNBT::ReadString(size_t & a_StringStart, size_t & a_StringLen)
NEEDBYTES(2);
a_StringStart = m_Pos + 2;
a_StringLen = static_cast<size_t>(GetBEShort(m_Data + m_Pos));
- if (a_StringLen > 0xffff)
- {
- // Suspicious string length
- return false;
- }
+ NEEDBYTES(a_StringLen);
m_Pos += 2 + a_StringLen;
return true;
}