Skip to content

Commit

Permalink
Check bitstream version in CPlayerJoinDataPacket
Browse files Browse the repository at this point in the history
  • Loading branch information
Lpsd committed Nov 22, 2023
1 parent db90a35 commit dc3f322
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<char*>(&m_Password), 16) && BitStream.ReadStringCharacters(m_strSerialUser, MAX_SERIAL_LENGTH) &&
BitStream.ReadStringCharacters(m_strConnectArgs, MAX_CONNECT_ARGS_LENGTH))
BitStream.Read(reinterpret_cast<char*>(&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;
Expand Down

0 comments on commit dc3f322

Please sign in to comment.