summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol18x.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-06-18 12:19:41 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-06-18 12:19:41 +0200
commit6920e468ad91e99bc16b9bf77ff59aff9d736826 (patch)
tree45950750727f24e3d13d526254f6f6faca87ce14 /src/Protocol/Protocol18x.cpp
parentFixes #2245 (diff)
downloadcuberite-6920e468ad91e99bc16b9bf77ff59aff9d736826.tar
cuberite-6920e468ad91e99bc16b9bf77ff59aff9d736826.tar.gz
cuberite-6920e468ad91e99bc16b9bf77ff59aff9d736826.tar.bz2
cuberite-6920e468ad91e99bc16b9bf77ff59aff9d736826.tar.lz
cuberite-6920e468ad91e99bc16b9bf77ff59aff9d736826.tar.xz
cuberite-6920e468ad91e99bc16b9bf77ff59aff9d736826.tar.zst
cuberite-6920e468ad91e99bc16b9bf77ff59aff9d736826.zip
Diffstat (limited to 'src/Protocol/Protocol18x.cpp')
-rw-r--r--src/Protocol/Protocol18x.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index d9449283b..7cbabf806 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -1921,12 +1921,11 @@ void cProtocol180::AddReceivedData(const char * a_Data, size_t a_Size)
{
// Decompress the data:
AString CompressedData;
- if (!m_ReceivedData.ReadString(CompressedData, CompressedSize))
+ if (!m_ReceivedData.ReadString(CompressedData, CompressedSize) || (InflateString(CompressedData.data(), CompressedSize, UncompressedData) != Z_OK))
{
m_Client->Kick("Compression failure");
return;
}
- InflateString(CompressedData.data(), CompressedSize, UncompressedData);
PacketLen = UncompressedData.size();
}
else