summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/network.cpp10
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);