From 6920e468ad91e99bc16b9bf77ff59aff9d736826 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 18 Jun 2015 11:19:41 +0100 Subject: Check the return value of InflateString Fixes #2256 --- src/Protocol/Protocol18x.cpp | 3 +-- 1 file changed, 1 insertion(+), 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 -- cgit v1.2.3