Core/Networking: Fixed a crash caused by attempting to connect directly to worldserver by setting portal=worldserver address
Closes #16927
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user