1
0
Fork 0

Protocol 1.8: Added checks for values presence.

Reported by @worktycho / Coverity.
This commit is contained in:
madmaxoft 2014-09-25 19:42:35 +02:00
parent c6f78d516b
commit 3459bc1ede
1 changed files with 8 additions and 2 deletions

View File

@ -1966,13 +1966,19 @@ void cProtocol180::HandlePacketStatusRequest(cByteBuffer & a_ByteBuffer)
void cProtocol180::HandlePacketLoginEncryptionResponse(cByteBuffer & a_ByteBuffer)
{
UInt32 EncKeyLength, EncNonceLength;
a_ByteBuffer.ReadVarInt(EncKeyLength);
if (!a_ByteBuffer.ReadVarInt(EncKeyLength))
{
return;
}
AString EncKey;
if (!a_ByteBuffer.ReadString(EncKey, EncKeyLength))
{
return;
}
a_ByteBuffer.ReadVarInt(EncNonceLength);
if (!a_ByteBuffer.ReadVarInt(EncNonceLength))
{
return;
}
AString EncNonce;
if (!a_ByteBuffer.ReadString(EncNonce, EncNonceLength))
{