wesnothd: avoid invalid iterator use when terminating game
Set game::owner_ to past-the-end iterator when game is being destroyed to avoid comparison with invalid iterator when remove_player() is called for other players after game host has disconnected making game::owner_ invalid.
This commit is contained in:
parent
12d4129aca
commit
e5a0400721
1 changed files with 1 additions and 0 deletions
|
@ -1450,6 +1450,7 @@ bool game::remove_player(player_iterator player, const bool disconnect, const bo
|
|||
}
|
||||
|
||||
if(game_ended || destruct) {
|
||||
owner_ = player_connections_.end();
|
||||
return game_ended;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue