1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Prevent logging from using already-freed game command (#8473)

gc variable is held by reference in the scope above, pointing to the
queue's beginning.
This commit is contained in:
Michał Janiszewski
2018-12-17 23:56:01 +01:00
committed by GitHub
parent 3cc6e1ab15
commit ea61be5ebe

View File

@@ -1885,12 +1885,12 @@ void Network::ProcessGameCommands()
{
// Having old command from a tick where we have not been active yet or malicious server,
// the command is useless so lets not keep it.
game_command_queue.erase(game_command_queue.begin());
log_warning(
"Discarding game command from tick behind current tick, CMD: %08X, CMD Tick: %08X, Current Tick: %08X\n",
gc.esi, gc.tick, gCurrentTicks);
game_command_queue.erase(game_command_queue.begin());
// At this point we should not return, would add the possibility to skip commands this tick.
continue;
}