1
0

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
This commit is contained in:
madmaxoft@gmail.com 2012-11-22 20:51:06 +00:00
parent 8191ed3b93
commit 95a94c3db8

View File

@ -297,7 +297,9 @@ bool cByteBuffer::ReadBool(bool & a_Value)
CHECK_THREAD; CHECK_THREAD;
CheckValid(); CheckValid();
NEEDBYTES(1); NEEDBYTES(1);
a_Value = (m_Buffer[m_ReadPos++] != 0); char Value = 0;
ReadBuf(&Value, 1);
a_Value = (Value != 0);
return true; return true;
} }