feat(received_event): add bounds checks to certain events (#985)

This commit is contained in:
yasmasdas 2023-02-14 21:29:17 +01:00 committed by GitHub
parent 8449eab503
commit c9cfde0a4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -393,6 +393,11 @@ namespace big
return;
}
}
else if (type > ScriptEntityChangeType::SetVehicleExclusiveDriver || type < ScriptEntityChangeType::BlockingOfNonTemporaryEvents) {
notify::crash_blocked(source_player, "invalid script entity change type");
g_pointers->m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset);
return;
}
buffer->Seek(0);
break;
}
@ -522,6 +527,11 @@ namespace big
return;
}
}
else if (type > WorldStateDataType::VehiclePlayerLocking || type < WorldStateDataType::CarGen) {
notify::crash_blocked(source_player, "invalid world state type");
g_pointers->m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset);
return;
}
buffer->Seek(0);
break;