summaryrefslogtreecommitdiff
path: root/src/game-server/commandhandler.cpp
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2013-08-20 18:56:10 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-08-26 22:56:48 +0200
commit64837cfccc3039fdd25d2e34c5f81949d34e1c95 (patch)
treed32cf93a01c6a5787ffbafb3d563654abab88f71 /src/game-server/commandhandler.cpp
parent81a88f1dd199691ce570ab124a43740b77a67f03 (diff)
downloadmanaserv-64837cfccc3039fdd25d2e34c5f81949d34e1c95.tar.gz
manaserv-64837cfccc3039fdd25d2e34c5f81949d34e1c95.tar.bz2
manaserv-64837cfccc3039fdd25d2e34c5f81949d34e1c95.tar.xz
manaserv-64837cfccc3039fdd25d2e34c5f81949d34e1c95.zip
Secured the use of the AttributeInfo where nessecary
In some cases no longer existing attribute ids sent by the account server or client were able to create crashs.
Diffstat (limited to 'src/game-server/commandhandler.cpp')
-rw-r--r--src/game-server/commandhandler.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game-server/commandhandler.cpp b/src/game-server/commandhandler.cpp
index ca08a636..79758bcf 100644
--- a/src/game-server/commandhandler.cpp
+++ b/src/game-server/commandhandler.cpp
@@ -1126,6 +1126,12 @@ static void handleAttribute(Entity *player, std::string &args)
auto *attribute = attributeManager->getAttributeInfo(attributeId);
+ if (!attribute)
+ {
+ say("Invalid attribute", player);
+ return;
+ }
+
// change the player's attribute
beingComponent->setAttribute(*other, attribute, value);