(svn r17611) -Fix: buffers used for verifying company and president name length were too short, possibly causing false positives

This commit is contained in:
smatz
2009-09-22 12:42:56 +00:00
parent 3a7da30922
commit 665864e5b0
3 changed files with 13 additions and 6 deletions

View File

@@ -1419,9 +1419,10 @@ struct TownNameParams {
*/
static bool VerifyTownName(uint32 r, const TownNameParams *par)
{
/* reserve space for extra unicode character and terminating '\0' */
char buf1[MAX_LENGTH_TOWN_NAME_BYTES + 4 + 1];
char buf2[MAX_LENGTH_TOWN_NAME_BYTES + 4 + 1];
/* Reserve space for extra unicode character. We need to do this to be able
* to detect too long town name. */
char buf1[MAX_LENGTH_TOWN_NAME_BYTES + MAX_CHAR_LENGTH];
char buf2[MAX_LENGTH_TOWN_NAME_BYTES + MAX_CHAR_LENGTH];
SetDParam(0, r);
if (par->grf && par->grfid != 0) {