VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Language.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Language.c')
-rw-r--r--src/Common/Language.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Common/Language.c b/src/Common/Language.c
index 3ec95dba..7853d18c 100644
--- a/src/Common/Language.c
+++ b/src/Common/Language.c
@@ -64,6 +64,7 @@ static char *MapNextLanguageFile ()
WIN32_FIND_DATAW find;
HANDLE file;
DWORD read;
+ BOOL bStatus;
if (LanguageFileFindHandle == INVALID_HANDLE_VALUE)
{
@@ -107,9 +108,9 @@ static char *MapNextLanguageFile ()
return NULL;
}
- ReadFile (file, LanguageFileBuffer, find.nFileSizeLow, &read, NULL);
+ bStatus = ReadFile (file, LanguageFileBuffer, find.nFileSizeLow, &read, NULL);
CloseHandle (file);
- if (read != find.nFileSizeLow)
+ if (!bStatus || (read != find.nFileSizeLow))
{
free(LanguageFileBuffer);
return NULL;