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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user