diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-08-16 04:04:31 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-08-16 10:04:07 +0200 |
commit | ce76957a10070c132a8adfbe2e7d3f12395b4caa (patch) | |
tree | df9ede22756dc23ff9e19555ccfba1c3db62cc77 /src/Common/BootEncryption.cpp | |
parent | 1bf219b0dca05edf337b322162169209cd224b6c (diff) | |
download | VeraCrypt-ce76957a10070c132a8adfbe2e7d3f12395b4caa.tar.gz VeraCrypt-ce76957a10070c132a8adfbe2e7d3f12395b4caa.zip |
Windows: Fix various issues detected by static analysis.
Diffstat (limited to 'src/Common/BootEncryption.cpp')
-rw-r--r-- | src/Common/BootEncryption.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp index 3b799d04..984402dc 100644 --- a/src/Common/BootEncryption.cpp +++ b/src/Common/BootEncryption.cpp @@ -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"; |