Core/Warden: Fixed a crash when Warden.ClientCheckFailAction was set to ban in the config, and Warden::Penalty was called in a context where check is NULL

closes #6736
This commit is contained in:
Subv
2012-06-10 21:40:27 -05:00
parent 7d98f2ffc7
commit 41b1416445
+5 -1
View File
@@ -188,7 +188,11 @@ std::string Warden::Penalty(WardenCheck* check /*= NULL*/)
std::string accountName;
AccountMgr::GetName(_session->GetAccountId(), accountName);
std::stringstream banReason;
banReason << "Warden Anticheat Violation: " << check->Comment << " (CheckId: " << check->CheckId << ")";
banReason << "Warden Anticheat Violation";
// Check can be NULL, for example if the client sent a wrong signature in the warden packet (CHECKSUM FAIL)
if (check)
banReason << ": " << check->Comment << " (CheckId: " << check->CheckId << ")";
sWorld->BanAccount(BAN_ACCOUNT, accountName, duration.str(), banReason.str(),"Server");
return "Ban";