mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-28 05:53:29 +01:00
Windows: fix buffer overrun issue when parsing language XML file
This commit is contained in:
parent
57343ce04c
commit
550e2bcf3b
@ -87,7 +87,7 @@ static char *MapNextLanguageFile ()
|
||||
if (find.nFileSizeHigh != 0) return NULL;
|
||||
|
||||
if (LanguageFileBuffer != NULL) free (LanguageFileBuffer);
|
||||
LanguageFileBuffer = malloc(find.nFileSizeLow);
|
||||
LanguageFileBuffer = malloc(find.nFileSizeLow + 1);
|
||||
if (LanguageFileBuffer == NULL) return NULL;
|
||||
|
||||
GetModuleFileNameW (NULL, f, sizeof (f) / sizeof(f[0]));
|
||||
@ -116,6 +116,8 @@ static char *MapNextLanguageFile ()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LanguageFileBuffer [find.nFileSizeLow] = 0; // we have allocated (find.nFileSizeLow + 1) bytes
|
||||
|
||||
return LanguageFileBuffer;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user