summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol18x.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-09-25 19:42:35 +0200
committermadmaxoft <github@xoft.cz>2014-09-25 19:42:35 +0200
commit3459bc1ede4ebbb8177444cc2b265ecea0678dea (patch)
treedda08a6efff474a9e6a3202319c6a71c4e963b56 /src/Protocol/Protocol18x.cpp
parentRedstone: Fixed a crash with repeaters on a chunk border. (diff)
downloadcuberite-3459bc1ede4ebbb8177444cc2b265ecea0678dea.tar
cuberite-3459bc1ede4ebbb8177444cc2b265ecea0678dea.tar.gz
cuberite-3459bc1ede4ebbb8177444cc2b265ecea0678dea.tar.bz2
cuberite-3459bc1ede4ebbb8177444cc2b265ecea0678dea.tar.lz
cuberite-3459bc1ede4ebbb8177444cc2b265ecea0678dea.tar.xz
cuberite-3459bc1ede4ebbb8177444cc2b265ecea0678dea.tar.zst
cuberite-3459bc1ede4ebbb8177444cc2b265ecea0678dea.zip
Diffstat (limited to '')
-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))
{