FIX(client,server): Packets of exactly max size were rejected

Due to an off-by-one error in the comparison logic, packets that are
exactly the maximum allowed size were rejected. This is now fixed.
This commit is contained in:
Robert Adam 2025-09-18 10:46:25 +02:00
parent 8ec1f98a2f
commit d1082ed0d4

View File

@ -300,7 +300,7 @@ namespace Protocol {
std::size_t writeSnippet(std::span< const byte > source, std::vector< byte > &destination, std::size_t offset,
std::size_t maxPacketSize) {
if (maxPacketSize <= offset + source.size()) {
if (maxPacketSize < offset + source.size()) {
qWarning("MumbleProtocol: Buffer overflow while writing snippet. Max buffer size is %zu and required size "
"is %zu",
maxPacketSize, offset + source.size());