From ce61f9fea632400ad5e5500f6592cfc3b3dbef39 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 31 Aug 2014 21:18:25 +0300 Subject: eathena: add missing check for packet id. --- src/net/eathena/network.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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(msgId) + < packet_lengths_size) + { + len = packet_lengths[msgId]; + } + } if (len == -1 && mInSize > 4) len = readWord(2); -- cgit v1.2.3-70-g09d2