(svn r6884) -Codechange: Add strict bounds checking in string formatting system.

The last parameter should point to the end of the buffer (eg lastof(buf))
 Courtesy of Tron.
This commit is contained in:
Darkvater
2006-10-21 23:31:34 +00:00
parent 7f36a980c7
commit ee27bb497c
33 changed files with 240 additions and 231 deletions

View File

@@ -826,7 +826,7 @@ void BackupVehicleOrders(const Vehicle *v, BackuppedOrders *bak)
if (!IsCustomName(v->string_id)) {
bak->name[0] = '\0';
} else {
GetName(v->string_id & 0x7FF, bak->name);
GetName(bak->name, v->string_id & 0x7FF, lastof(bak->name));
}
/* If we have shared orders, store it on a special way */