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

Windows: Fix various issues detected by static analysis.

This commit is contained in:
Mounir IDRASSI
2016-08-16 04:04:31 +02:00
parent 1bf219b0dc
commit ce76957a10
8 changed files with 37 additions and 30 deletions

View File

@@ -198,6 +198,9 @@ namespace VeraCrypt
if (bstr)
{
CComBSTR inputBstr;
CComBSTR fileBstr;
fileBstr.Attach (bstr);
if (input && inputBstr.AppendBytes ((const char *) input, inputSize) != S_OK)
{
SetLastError (ERROR_INVALID_PARAMETER);
@@ -211,8 +214,6 @@ namespace VeraCrypt
return FALSE;
}
CComBSTR fileBstr;
fileBstr.Attach (bstr);
result = ElevatedComInstance->DeviceIoControl (readOnly, device, fileBstr, dwIoControlCode, inputBstr, &outputBstr);
if (output)
@@ -2071,6 +2072,8 @@ namespace VeraCrypt
EfiBoot::EfiBoot() {
ZeroMemory(EfiBootPartPath, sizeof(EfiBootPartPath));
ZeroMemory (systemPartitionPath, sizeof (systemPartitionPath));
ZeroMemory (&sdn, sizeof (sdn));
ZeroMemory (&partInfo, sizeof (partInfo));
m_bMounted = false;
}
@@ -2288,7 +2291,7 @@ namespace VeraCrypt
wchar_t varName[256];
StringCchPrintfW(varName, ARRAYSIZE (varName), L"%s%04X", type == NULL ? L"Boot" : type, statrtOrderNum);
SetFirmwareEnvironmentVariable(varName, EfiVarGuid, startVar, varSize);
delete startVar;
delete [] startVar;
// Update order
wstring order = L"Order";