summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-02 05:11:50 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-02 05:11:50 +0300
commitf498d80c587033bffb9abedb2b0827ad8d4a2a32 (patch)
tree82da8928768b2159c199c2d033388a071f228582 /src/net/tmwa
parent1ba44aeb62414ea349e462b6d4fccbaac00be115 (diff)
downloadmanaverse-f498d80c587033bffb9abedb2b0827ad8d4a2a32.tar.gz
manaverse-f498d80c587033bffb9abedb2b0827ad8d4a2a32.tar.bz2
manaverse-f498d80c587033bffb9abedb2b0827ad8d4a2a32.tar.xz
manaverse-f498d80c587033bffb9abedb2b0827ad8d4a2a32.zip
Add some checks after automatic checking.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/charserverhandler.cpp7
-rw-r--r--src/net/tmwa/playerhandler.cpp3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 717df1284..1bee91144 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -364,8 +364,11 @@ void CharServerHandler::processCharLogin(Net::MessageIn &msg)
Net::Character *character = new Net::Character;
readPlayerData(msg, character, version);
mCharacters.push_back(character);
- logger->log("CharServer: Player: %s (%d)",
- character->dummy->getName().c_str(), character->slot);
+ if (character && character->dummy)
+ {
+ logger->log("CharServer: Player: %s (%d)",
+ character->dummy->getName().c_str(), character->slot);
+ }
}
Client::setState(STATE_CHAR_SELECT);
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index 8747cf9c4..16e833ec9 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -229,6 +229,9 @@ void PlayerHandler::processOnlineList(Net::MessageIn &msg)
}
char *start = (char*)msg.readBytes(size);
+ if (!start)
+ return;
+
char *buf = start;
int addVal = 1;