summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol18x.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Protocol/Protocol18x.cpp')
-rw-r--r--src/Protocol/Protocol18x.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index 94eaa43db..c07441ef7 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -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))
{