mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
fix(core/packet): prevent client crash from malformed packet/message (#2910)
* Update AuctionHouseHandler.cpp * fix(core/packet): prevent crash from malformed string
This commit is contained in:
@@ -97,7 +97,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (sender->HasAura(1852) && type != CHAT_MSG_WHISPER)
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_GM_SILENCE), sender->GetName().c_str());
|
||||
@@ -113,7 +113,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
recvData.rfinish();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (langDesc->skill_id != 0 && !sender->HasSkill(langDesc->skill_id))
|
||||
{
|
||||
// also check SPELL_AURA_COMPREHEND_LANGUAGE (client offers option to speak in that language)
|
||||
@@ -185,7 +185,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
|
||||
break;
|
||||
default:
|
||||
sLog->outError("Player %s (GUID: %u) sent a chatmessage with an invalid language/message type combination",
|
||||
sLog->outError("Player %s (GUID: %u) sent a chatmessage with an invalid language/message type combination",
|
||||
GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow());
|
||||
|
||||
recvData.rfinish();
|
||||
@@ -329,6 +329,11 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
}
|
||||
}
|
||||
|
||||
// prevent crash player
|
||||
if (msg.find("| |Hquest") != std::string::npos) {
|
||||
return;
|
||||
}
|
||||
|
||||
sScriptMgr->OnBeforeSendChatMessage(_player, type, lang, msg);
|
||||
|
||||
switch (type)
|
||||
|
||||
Reference in New Issue
Block a user