Skip to content

Commit

Permalink
Core/Networking: Fixed a crash caused by attempting to connect direct…
Browse files Browse the repository at this point in the history
…ly to worldserver by setting portal=worldserver address

Closes #16927
  • Loading branch information
Shauren committed Apr 9, 2016
1 parent 4c9d187 commit 174a614
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/server/game/Server/WorldSocket.cpp
Expand Up @@ -168,9 +168,21 @@ void WorldSocket::InitializeHandler(boost::system::error_code error, std::size_t
ByteBuffer buffer(std::move(_packetBuffer));

buffer >> magic;
if (magic != ConnectionInitializeMagic)
{
CloseSocket();
return;
}

buffer >> length;
if (length > ClientConnectionInitialize.length())
{
CloseSocket();
return;
}

std::string initializer = buffer.ReadString(length);
if (magic != ConnectionInitializeMagic || initializer != ClientConnectionInitialize)
if (initializer != ClientConnectionInitialize)
{
CloseSocket();
return;
Expand Down

0 comments on commit 174a614

Please sign in to comment.