From 64837cfccc3039fdd25d2e34c5f81949d34e1c95 Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Tue, 20 Aug 2013 18:56:10 +0200 Subject: 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. --- src/game-server/commandhandler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/game-server/commandhandler.cpp') 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); -- cgit v1.2.3-60-g2f50