summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-09-28 22:25:48 +0200
committermadmaxoft <github@xoft.cz>2014-09-28 22:25:48 +0200
commitf8c627141ae930abfeb2a76599133a455bceaa9b (patch)
tree9406a0670f23c14178cefbfe94c85d04adb4952b
parentFixed trailing whitespace. (diff)
downloadcuberite-f8c627141ae930abfeb2a76599133a455bceaa9b.tar
cuberite-f8c627141ae930abfeb2a76599133a455bceaa9b.tar.gz
cuberite-f8c627141ae930abfeb2a76599133a455bceaa9b.tar.bz2
cuberite-f8c627141ae930abfeb2a76599133a455bceaa9b.tar.lz
cuberite-f8c627141ae930abfeb2a76599133a455bceaa9b.tar.xz
cuberite-f8c627141ae930abfeb2a76599133a455bceaa9b.tar.zst
cuberite-f8c627141ae930abfeb2a76599133a455bceaa9b.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol18x.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index 7a6eb5f28..625a29b7a 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -1713,6 +1713,11 @@ void cProtocol180::AddReceivedData(const char * a_Data, size_t a_Size)
{
UInt32 NumBytesRead = m_ReceivedData.GetReadableSpace();
m_ReceivedData.ReadVarInt(CompressedSize);
+ if (CompressedSize > PacketLen)
+ {
+ m_Client->Kick("Bad compression");
+ return;
+ }
if (CompressedSize > 0)
{
// Decompress the data: