• Chen Bill's avatar
    disconnect when the packet is too large (#2551) · e209e775
    Chen Bill authored
    * use memcpy in DuelClient, NetServer
    
    * NetServer: discard too large packet
    
    * DuelClient: discard too large packet
    
    * replace memcpy with std::memcpy
    
    * disconnect when the packet is too large
    
    * check packet_len
    
    * check len in HandleCTOSPacket()
    
    * check len in HandleSTOCPacketLan()
    
    * remove bool type in HostInfo
    
    * check len in packet handling
    
    * add boundary check to STOC_CHAT packet
    
    * use memcpy in DuelMode::JoinGame
    
    * add DECK_MAX_SIZE, DECK_MIN_SIZE
    
    * fix DuelMode::UpdateDeck()
    
    * fix
    
    * fix Manager::OpenDeckFile()
    
    * update DuelMode init
    
    * update DuelMode::JoinGame
    
    * update DuelMode::GetResponse
    
    * Revert "check len in packet handling"
    
    This reverts commit 2b5c12f3.
    
    * use memcpy in GetPosition
    
    * check struct size by static_assert
    
    * update DuelMode::UpdateDeck
    
    * check if the struct is trivially copyable
    
    * replace unsigned short to uint16_t
    
    * replace unsigned int to uint32_t
    
    * add padding member to STOC_HS_PlayerEnter
    
    * workaround: use STOC_HS_PlayerEnter_size
    e209e775
single_duel.cpp 54.4 KB