Protocol 1.8: Added checks for values presence.
Reported by @worktycho / Coverity.
This commit is contained in:
parent
c6f78d516b
commit
3459bc1ede
@ -1966,13 +1966,19 @@ void cProtocol180::HandlePacketStatusRequest(cByteBuffer & a_ByteBuffer)
|
|||||||
void cProtocol180::HandlePacketLoginEncryptionResponse(cByteBuffer & a_ByteBuffer)
|
void cProtocol180::HandlePacketLoginEncryptionResponse(cByteBuffer & a_ByteBuffer)
|
||||||
{
|
{
|
||||||
UInt32 EncKeyLength, EncNonceLength;
|
UInt32 EncKeyLength, EncNonceLength;
|
||||||
a_ByteBuffer.ReadVarInt(EncKeyLength);
|
if (!a_ByteBuffer.ReadVarInt(EncKeyLength))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
AString EncKey;
|
AString EncKey;
|
||||||
if (!a_ByteBuffer.ReadString(EncKey, EncKeyLength))
|
if (!a_ByteBuffer.ReadString(EncKey, EncKeyLength))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
a_ByteBuffer.ReadVarInt(EncNonceLength);
|
if (!a_ByteBuffer.ReadVarInt(EncNonceLength))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
AString EncNonce;
|
AString EncNonce;
|
||||||
if (!a_ByteBuffer.ReadString(EncNonce, EncNonceLength))
|
if (!a_ByteBuffer.ReadString(EncNonce, EncNonceLength))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user