diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-09-05 02:13:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-09-05 02:13:20 +0300 |
commit | 0491808a50932918ce09c98a394a941b9239670a (patch) | |
tree | c2f0cc388e4b7951ecc0b275746c1796f845522b /src/net/eathena/mail2recv.cpp | |
parent | 9e48f292f14fe96c98b5cfe18a32bcb1bc3d7c24 (diff) | |
download | plus-0491808a50932918ce09c98a394a941b9239670a.tar.gz plus-0491808a50932918ce09c98a394a941b9239670a.tar.bz2 plus-0491808a50932918ce09c98a394a941b9239670a.tar.xz plus-0491808a50932918ce09c98a394a941b9239670a.zip |
Fix receiving half broken packet with mail message (SMSG_MAIL2_READ_MAIL).
Where items present in count, but not present in data.
Diffstat (limited to 'src/net/eathena/mail2recv.cpp')
-rw-r--r-- | src/net/eathena/mail2recv.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp index b2e435bee..8b4d1dd8b 100644 --- a/src/net/eathena/mail2recv.cpp +++ b/src/net/eathena/mail2recv.cpp @@ -406,6 +406,9 @@ void Mail2Recv::processReadMail(Net::MessageIn &msg) for (int f = 0; f < itemsCount; f ++) { + // server may send wrong items count, if items was removed from mail + if (msg.getUnreadLength() == 0) + break; const int amount = msg.readInt16("amount"); const int itemId = msg.readInt16("item id"); const uint8_t identify = msg.readUInt8("identify"); |