VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Language.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Common/Language.c b/src/Common/Language.c
index e9d3a573..e5b7a314 100644
--- a/src/Common/Language.c
+++ b/src/Common/Language.c
@@ -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;
}