mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 23:35:41 +00:00
fix typo in DeComp buffer size logic
This commit is contained in:
parent
0950d367d4
commit
baa2c86e25
@ -412,7 +412,7 @@ std::vector<uint8_t> DeComp(std::span<const uint8_t> input) {
|
|||||||
// into huge data.
|
// into huge data.
|
||||||
// If this limit were to be an issue, this could be made configurable, however clients have a similar
|
// 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.
|
// 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));
|
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
|
// if decompression fails, we double the buffer size (up to the allowed limit) and try again
|
||||||
|
Loading…
x
Reference in New Issue
Block a user