mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Fix potential crash on corrupted network data
This commit is contained in:
@@ -2488,6 +2488,12 @@ void NetworkBase::Server_Handle_MAPREQUEST(NetworkConnection& connection, Networ
|
||||
for (uint32_t i = 0; i < size; i++)
|
||||
{
|
||||
const char* name = reinterpret_cast<const char*>(packet.Read(8));
|
||||
if (name == nullptr)
|
||||
{
|
||||
log_error("Client sent malformed object request data %s", connection.Socket->GetHostName());
|
||||
return;
|
||||
}
|
||||
|
||||
// This is required, as packet does not have null terminator
|
||||
std::string s(name, name + 8);
|
||||
log_verbose("Client requested object %s", s.c_str());
|
||||
|
||||
Reference in New Issue
Block a user