From af55e166f6be570fc2af2bcfafb5e6f83cd8ea86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Czern=C3=BD?= Date: Tue, 9 Feb 2021 12:41:50 +0100 Subject: [PATCH] B #5219: Fix zlib_decompress in Message.cc (#776) --- src/monitor/src/protocol/Message.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/monitor/src/protocol/Message.cc b/src/monitor/src/protocol/Message.cc index e953a680fa..15376f35ce 100644 --- a/src/monitor/src/protocol/Message.cc +++ b/src/monitor/src/protocol/Message.cc @@ -173,7 +173,8 @@ int zlib_decompress(const std::string& in, std::string& out) rc = inflate(&zs, Z_FINISH); - if ( rc != Z_STREAM_END && rc != Z_OK ) + if ( (rc != Z_STREAM_END && rc != Z_OK && rc != Z_BUF_ERROR) + || (rc == Z_BUF_ERROR && zs.avail_out == ZBUFFER) ) { inflateEnd(&zs);