mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[8773] Prevent counter overflow in mail list oacket sent to client.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
44fb72aeff
commit
6b1e76a150
2 changed files with 8 additions and 1 deletions
|
|
@ -529,6 +529,13 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data )
|
|||
|
||||
for(PlayerMails::iterator itr = _player->GetMailBegin(); itr != _player->GetMailEnd(); ++itr)
|
||||
{
|
||||
// packet send mail count as uint8, prevent overflow
|
||||
if(mailsCount >= 254)
|
||||
{
|
||||
realCount += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
// skip deleted or not delivered (deliver delay not expired) mails
|
||||
if ((*itr)->state == MAIL_STATE_DELETED || cur_time < (*itr)->deliver_time)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue