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
master
madmaxoft@gmail.com 2012-11-22 20:51:06 +00:00
parent 8191ed3b93
commit 95a94c3db8
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}