diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-09-27 23:22:26 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-09-27 23:22:26 +0200 |
commit | 04ee8c43dd17eb98d1e3d66ff691898e9f269b95 (patch) | |
tree | 6c26c4c9d6a046613886a194738d18d6f5ca82f0 | |
parent | QtBiomeVisualiser: fixed compilation. (diff) | |
download | cuberite-04ee8c43dd17eb98d1e3d66ff691898e9f269b95.tar cuberite-04ee8c43dd17eb98d1e3d66ff691898e9f269b95.tar.gz cuberite-04ee8c43dd17eb98d1e3d66ff691898e9f269b95.tar.bz2 cuberite-04ee8c43dd17eb98d1e3d66ff691898e9f269b95.tar.lz cuberite-04ee8c43dd17eb98d1e3d66ff691898e9f269b95.tar.xz cuberite-04ee8c43dd17eb98d1e3d66ff691898e9f269b95.tar.zst cuberite-04ee8c43dd17eb98d1e3d66ff691898e9f269b95.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol18x.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp index a2dbb7a1f..4ec447401 100644 --- a/src/Protocol/Protocol18x.cpp +++ b/src/Protocol/Protocol18x.cpp @@ -989,7 +989,6 @@ void cProtocol180::SendPluginMessage(const AString & a_Channel, const AString & cPacketizer Pkt(*this, 0x3f); Pkt.WriteString(a_Channel); - Pkt.WriteVarInt((UInt32)a_Message.size()); Pkt.WriteBuf(a_Message.data(), a_Message.size()); } @@ -2316,9 +2315,11 @@ void cProtocol180::HandlePacketPlayerPosLook(cByteBuffer & a_ByteBuffer) void cProtocol180::HandlePacketPluginMessage(cByteBuffer & a_ByteBuffer) { HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Channel); - HANDLE_READ(a_ByteBuffer, ReadVarInt, UInt32, DataLen); AString Data; - a_ByteBuffer.ReadString(Data, DataLen); + if (!a_ByteBuffer.ReadString(Data, a_ByteBuffer.GetReadableSpace() - 1)) + { + return; + } m_Client->HandlePluginMessage(Channel, Data); } |