Some more safety measures with LangString
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1319 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
2f61bc023e
commit
1ffbd1351b
1 changed files with 14 additions and 1 deletions
|
@ -84,7 +84,20 @@ StringTable* CEXEBuild::GetTable(LANGID &lang) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
memset(table, 0, sizeof(StringTable)-sizeof(GrowBuf)*2);
|
memset(table, 0, sizeof(StringTable)-sizeof(GrowBuf)*2);
|
||||||
table->lang_id = table->lang_id = lang;
|
table->lang_id = lang;
|
||||||
|
|
||||||
|
int zero = 0;
|
||||||
|
|
||||||
|
// make sure all of the user's strings tables are the same size
|
||||||
|
for (int j = 0; j < string_tables.size(); j++) {
|
||||||
|
int i = build_userlangstrings.getnum();
|
||||||
|
i -= table->user_strings.getlen() / sizeof(int);
|
||||||
|
while (i--) table->user_strings.add(&zero, sizeof(int));
|
||||||
|
|
||||||
|
i = ubuild_userlangstrings.getnum();
|
||||||
|
i -= table->user_ustrings.getlen() / sizeof(int);
|
||||||
|
while (i--) table->user_ustrings.add(&zero, sizeof(int));
|
||||||
|
}
|
||||||
string_tables.push_back(table);
|
string_tables.push_back(table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue