mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16: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)
|
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
|
// skip deleted or not delivered (deliver delay not expired) mails
|
||||||
if ((*itr)->state == MAIL_STATE_DELETED || cur_time < (*itr)->deliver_time)
|
if ((*itr)->state == MAIL_STATE_DELETED || cur_time < (*itr)->deliver_time)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8772"
|
#define REVISION_NR "8773"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue