1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Static Code Analysis: handle unused variables more properly. Catch STL exception. Add more checks. Add proper cast to arithmetic operations.

This commit is contained in:
Mounir IDRASSI
2015-02-08 23:36:01 +01:00
parent 1ab00f3e3c
commit de0c30dded
10 changed files with 23 additions and 18 deletions

View File

@@ -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;