diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-09-02 19:37:03 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-09-02 19:37:03 +0200 |
commit | b8769e3fb48ce05f7a76e9e55b9d864f3474d311 (patch) | |
tree | b2842e686fe509bf65d5b7df1f311706ce0de6f3 /src/Protocol | |
parent | WebAdmin: Exported logo and background. (diff) | |
parent | Re-added alternate spellings of darkgraywool. (diff) | |
download | cuberite-b8769e3fb48ce05f7a76e9e55b9d864f3474d311.tar cuberite-b8769e3fb48ce05f7a76e9e55b9d864f3474d311.tar.gz cuberite-b8769e3fb48ce05f7a76e9e55b9d864f3474d311.tar.bz2 cuberite-b8769e3fb48ce05f7a76e9e55b9d864f3474d311.tar.lz cuberite-b8769e3fb48ce05f7a76e9e55b9d864f3474d311.tar.xz cuberite-b8769e3fb48ce05f7a76e9e55b9d864f3474d311.tar.zst cuberite-b8769e3fb48ce05f7a76e9e55b9d864f3474d311.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/MojangAPI.cpp | 3 | ||||
-rw-r--r-- | src/Protocol/ProtocolRecognizer.cpp | 30 |
2 files changed, 26 insertions, 7 deletions
diff --git a/src/Protocol/MojangAPI.cpp b/src/Protocol/MojangAPI.cpp index 4e5c41a8a..28da83c31 100644 --- a/src/Protocol/MojangAPI.cpp +++ b/src/Protocol/MojangAPI.cpp @@ -158,7 +158,8 @@ cMojangAPI::cMojangAPI(void) : m_NameToUUIDServer(DEFAULT_NAME_TO_UUID_SERVER), m_NameToUUIDAddress(DEFAULT_NAME_TO_UUID_ADDRESS), m_UUIDToProfileServer(DEFAULT_UUID_TO_PROFILE_SERVER), - m_UUIDToProfileAddress(DEFAULT_UUID_TO_PROFILE_ADDRESS) + m_UUIDToProfileAddress(DEFAULT_UUID_TO_PROFILE_ADDRESS), + m_RankMgr(NULL) { } diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp index c831da251..8b395230a 100644 --- a/src/Protocol/ProtocolRecognizer.cpp +++ b/src/Protocol/ProtocolRecognizer.cpp @@ -979,9 +979,18 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema AString ServerAddress; short ServerPort; UInt32 NextState; - m_Buffer.ReadVarUTF8String(ServerAddress); - m_Buffer.ReadBEShort(ServerPort); - m_Buffer.ReadVarInt(NextState); + if (!m_Buffer.ReadVarUTF8String(ServerAddress)) + { + break; + } + if (!m_Buffer.ReadBEShort(ServerPort)) + { + break; + } + if (!m_Buffer.ReadVarInt(NextState)) + { + break; + } m_Buffer.CommitRead(); m_Protocol = new cProtocol172(m_Client, ServerAddress, (UInt16)ServerPort, NextState); return true; @@ -991,9 +1000,18 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema AString ServerAddress; short ServerPort; UInt32 NextState; - m_Buffer.ReadVarUTF8String(ServerAddress); - m_Buffer.ReadBEShort(ServerPort); - m_Buffer.ReadVarInt(NextState); + if (!m_Buffer.ReadVarUTF8String(ServerAddress)) + { + break; + } + if (!m_Buffer.ReadBEShort(ServerPort)) + { + break; + } + if (!m_Buffer.ReadVarInt(NextState)) + { + break; + } m_Buffer.CommitRead(); m_Protocol = new cProtocol176(m_Client, ServerAddress, (UInt16)ServerPort, NextState); return true; |