From 95a94c3db85fa7c94a5e359ee691b72263111869 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 22 Nov 2012 20:51:06 +0000 Subject: ByteBuffer: Fixed buffer overrun possibility. http://forum.mc-server.org/showthread.php?tid=633&pid=5473#pid5473 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1063 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/ByteBuffer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/ByteBuffer.cpp') diff --git a/source/ByteBuffer.cpp b/source/ByteBuffer.cpp index 75464ba45..028b4f08a 100644 --- a/source/ByteBuffer.cpp +++ b/source/ByteBuffer.cpp @@ -297,7 +297,9 @@ bool cByteBuffer::ReadBool(bool & a_Value) CHECK_THREAD; CheckValid(); NEEDBYTES(1); - a_Value = (m_Buffer[m_ReadPos++] != 0); + char Value = 0; + ReadBuf(&Value, 1); + a_Value = (Value != 0); return true; } -- cgit v1.2.3