mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/PacketIO: Validate utf8 in every client packet
(cherry picked from commit 0a2a96efaa)
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#include "ObjectMgr.h" // for normalizePlayerName
|
||||
#include "Player.h"
|
||||
#include <cctype>
|
||||
#include <utf8.h>
|
||||
|
||||
static size_t const MAX_CHANNEL_NAME_STR = 0x31;
|
||||
static size_t const MAX_CHANNEL_PASS_STR = 31;
|
||||
@@ -48,12 +47,6 @@ void WorldSession::HandleJoinChannel(WorldPackets::Channel::JoinChannel& packet)
|
||||
if (packet.ChannelName.empty())
|
||||
return;
|
||||
|
||||
if (!utf8::is_valid(packet.ChannelName.begin(), packet.ChannelName.end()))
|
||||
{
|
||||
TC_LOG_ERROR("network", "Player %s tried to create a channel with an invalid UTF8 sequence - blocked", GetPlayer()->GetGUID().ToString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ValidateHyperlinksAndMaybeKick(packet.ChannelName))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user