fix typo in DeComp buffer size logic

This commit is contained in:
Lion 2024-07-15 12:35:32 +02:00 committed by GitHub
parent 0950d367d4
commit baa2c86e25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -412,7 +412,7 @@ std::vector<uint8_t> DeComp(std::span<const uint8_t> 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