From baa2c86e25f93bcd22ff1f1fc4e5e6e21b261f52 Mon Sep 17 00:00:00 2001 From: Lion Date: Mon, 15 Jul 2024 12:35:32 +0200 Subject: [PATCH] fix typo in DeComp buffer size logic --- src/Common.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Common.cpp b/src/Common.cpp index 7441b05..597011d 100644 --- a/src/Common.cpp +++ b/src/Common.cpp @@ -412,7 +412,7 @@ std::vector DeComp(std::span input) { // into huge data. // If this limit were to be an issue, this could be made configurable, however clients have a similar // limit. For that reason, we just reject packets which decompress into too much data. - if (output_buffer.size() > MAX_DECOMPRESSION_BUFFER_SIZE) { + if (output_buffer.size() >= MAX_DECOMPRESSION_BUFFER_SIZE) { throw std::runtime_error(fmt::format("decompressed packet size of {} bytes exceeded", MAX_DECOMPRESSION_BUFFER_SIZE)); } // if decompression fails, we double the buffer size (up to the allowed limit) and try again