From 3963a7204664e37415ed1a1ca140864c9dd402f3 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 29 Nov 2013 18:39:40 +0100 Subject: [PATCH] Fixed an off-by-one error in cByteBuffer. Could have caused random protocol errors and maybe even crashes. --- src/ByteBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp index 8f2b76c1..a6be09ad 100644 --- a/src/ByteBuffer.cpp +++ b/src/ByteBuffer.cpp @@ -818,7 +818,7 @@ void cByteBuffer::AdvanceReadPos(int a_Count) CHECK_THREAD; CheckValid(); m_ReadPos += a_Count; - if (m_ReadPos > m_BufferSize) + if (m_ReadPos >= m_BufferSize) { m_ReadPos -= m_BufferSize; }