diff options
author | madmaxoft <github@xoft.cz> | 2014-09-28 22:25:48 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-09-28 22:25:48 +0200 |
commit | f8c627141ae930abfeb2a76599133a455bceaa9b (patch) | |
tree | 9406a0670f23c14178cefbfe94c85d04adb4952b /src/Protocol | |
parent | Fixed trailing whitespace. (diff) | |
download | cuberite-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 'src/Protocol')
-rw-r--r-- | src/Protocol/Protocol18x.cpp | 5 |
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: |