(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:
@@ -99,12 +99,12 @@ static int CDECL EngineNameSorter(const void *a, const void *b)
|
||||
|
||||
if (va != last_engine[0]) {
|
||||
last_engine[0] = va;
|
||||
GetString(last_name[0], GetCustomEngineName(va));
|
||||
GetString(last_name[0], GetCustomEngineName(va), lastof(last_name[0]));
|
||||
}
|
||||
|
||||
if (vb != last_engine[1]) {
|
||||
last_engine[1] = vb;
|
||||
GetString(last_name[1], GetCustomEngineName(vb));
|
||||
GetString(last_name[1], GetCustomEngineName(vb), lastof(last_name[1]));
|
||||
}
|
||||
|
||||
r = strcmp(last_name[0], last_name[1]); // sort by name
|
||||
|
||||
Reference in New Issue
Block a user