mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #20964: Crash when invalid network group id is used
This commit is contained in:
parent
b12d659db3
commit
37cdc40799
|
@ -2643,7 +2643,10 @@ void NetworkBase::ServerHandleAuth(NetworkConnection& connection, NetworkPacket&
|
|||
if (connection.AuthStatus == NetworkAuth::Verified)
|
||||
{
|
||||
const NetworkGroup* group = GetGroupByID(GetGroupIDByHash(connection.Key.PublicKeyHash()));
|
||||
passwordless = group->CanPerformAction(NetworkPermission::PasswordlessLogin);
|
||||
if (group != nullptr)
|
||||
{
|
||||
passwordless = group->CanPerformAction(NetworkPermission::PasswordlessLogin);
|
||||
}
|
||||
}
|
||||
if (gameversion != NetworkGetVersion())
|
||||
{
|
||||
|
@ -3649,6 +3652,11 @@ GameActions::Result NetworkModifyGroups(
|
|||
case ModifyGroupType::SetName:
|
||||
{
|
||||
NetworkGroup* group = network.GetGroupByID(groupId);
|
||||
if (group == nullptr)
|
||||
{
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_GROUP, STR_NONE);
|
||||
}
|
||||
|
||||
const char* oldName = group->GetName().c_str();
|
||||
|
||||
if (strcmp(oldName, name.c_str()) == 0)
|
||||
|
|
Loading…
Reference in New Issue