summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/manaserv/loginhandler.cpp9
-rw-r--r--src/net/tmwa/loginhandler.cpp5
2 files changed, 14 insertions, 0 deletions
diff --git a/src/net/manaserv/loginhandler.cpp b/src/net/manaserv/loginhandler.cpp
index 1edfbb6b6..818886b38 100644
--- a/src/net/manaserv/loginhandler.cpp
+++ b/src/net/manaserv/loginhandler.cpp
@@ -341,9 +341,18 @@ void LoginHandler::readServerInfo(Net::MessageIn &msg)
// Set the update host when included in the message
const std::string updateHost = msg.readString();
if (!updateHost.empty())
+ {
+ if (!checkPath(updateHost))
+ {
+ logger->log1("Warning: incorrect update server name");
+ updateHost = "";
+ }
mLoginData->updateHost = updateHost;
+ }
else
+ {
logger->log1("Warning: server does not have an update host set!");
+ }
// Read the client data folder for dynamic data loading.
// This is only used by the QT client.
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index 7f73057b4..12a3d7b19 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -110,6 +110,11 @@ void LoginHandler::handleMessage(Net::MessageIn &msg)
len = msg.readInt16() - 4;
mUpdateHost = msg.readString(len);
+ if (!checkPath(mUpdateHost))
+ {
+ mUpdateHost = "";
+ logger->log1("Warning: incorrect update server name");
+ }
loginData.updateHost = mUpdateHost;
logger->log("Received update host \"%s\" from login server.",