diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-31 21:18:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 01:18:54 +0300 |
commit | ce61f9fea632400ad5e5500f6592cfc3b3dbef39 (patch) | |
tree | 84c8a3d57227cd6eb96052151448edf37d73951e /src/net | |
parent | 09f17e5add2fd2fd0b8c907fda6e3b6c0c010f49 (diff) | |
download | manaplus-ce61f9fea632400ad5e5500f6592cfc3b3dbef39.tar.gz manaplus-ce61f9fea632400ad5e5500f6592cfc3b3dbef39.tar.bz2 manaplus-ce61f9fea632400ad5e5500f6592cfc3b3dbef39.tar.xz manaplus-ce61f9fea632400ad5e5500f6592cfc3b3dbef39.zip |
eathena: add missing check for packet id.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/network.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp index 71eaf4181..fe13b2f86 100644 --- a/src/net/eathena/network.cpp +++ b/src/net/eathena/network.cpp @@ -144,9 +144,17 @@ bool Network::messageReady() { const int msgId = readWord(0); if (msgId == SMSG_UPDATE_HOST2) + { len = -1; + } else - len = packet_lengths[msgId]; + { + if (msgId >= 0 && static_cast<unsigned int>(msgId) + < packet_lengths_size) + { + len = packet_lengths[msgId]; + } + } if (len == -1 && mInSize > 4) len = readWord(2); |