1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-02 19:39:12 +00:00

Fix: Corrupted savegame could cause heap corruption by writing outside link graph edge matrix. (#9046)

This commit is contained in:
Milek7
2021-04-17 20:19:37 +02:00
committed by GitHub
parent da55286c2c
commit aade177d79

View File

@@ -151,6 +151,7 @@ void SaveLoad_LinkGraph(LinkGraph &lg)
} else {
/* ... but as that wasted a lot of space we save a sparse matrix now. */
for (NodeID to = from; to != INVALID_NODE; to = lg.edges[from][to].next_edge) {
if (to >= size) SlErrorCorrupt("Link graph structure overflow");
SlObject(&lg.edges[from][to], _edge_desc);
}
}