From dc3f3224f7562a2af38f395a76c658c2c012b20d Mon Sep 17 00:00:00 2001 From: Lpsd <40902730+Lpsd@users.noreply.github.com> Date: Wed, 22 Nov 2023 23:05:44 +0000 Subject: [PATCH] Check bitstream version in CPlayerJoinDataPacket --- .../mods/deathmatch/logic/packets/CPlayerJoinDataPacket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Server/mods/deathmatch/logic/packets/CPlayerJoinDataPacket.cpp b/Server/mods/deathmatch/logic/packets/CPlayerJoinDataPacket.cpp index 1bc309c5e4..e59db1b57a 100644 --- a/Server/mods/deathmatch/logic/packets/CPlayerJoinDataPacket.cpp +++ b/Server/mods/deathmatch/logic/packets/CPlayerJoinDataPacket.cpp @@ -26,9 +26,11 @@ bool CPlayerJoinDataPacket::Read(NetBitStreamInterface& BitStream) m_bOptionalUpdateInfoRequired = BitStream.ReadBit(); if (BitStream.Read(m_ucGameVersion) && BitStream.ReadStringCharacters(m_strNick, MAX_PLAYER_NICK_LENGTH) && - BitStream.Read(reinterpret_cast(&m_Password), 16) && BitStream.ReadStringCharacters(m_strSerialUser, MAX_SERIAL_LENGTH) && - BitStream.ReadStringCharacters(m_strConnectArgs, MAX_CONNECT_ARGS_LENGTH)) + BitStream.Read(reinterpret_cast(&m_Password), 16) && BitStream.ReadStringCharacters(m_strSerialUser, MAX_SERIAL_LENGTH)) { + if (BitStream.Can(eBitStreamVersion::CPlayerJoinDataPacket_ProtocolConnectArgs)) + BitStream.ReadStringCharacters(m_strConnectArgs, MAX_CONNECT_ARGS_LENGTH); + // Shrink string sizes to fit m_strNick = *m_strNick; m_strSerialUser = *m_strSerialUser;