VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-16 04:04:31 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-16 10:04:07 +0200
commitce76957a10070c132a8adfbe2e7d3f12395b4caa (patch)
treedf9ede22756dc23ff9e19555ccfba1c3db62cc77 /src/Common
parent1bf219b0dca05edf337b322162169209cd224b6c (diff)
downloadVeraCrypt-ce76957a10070c132a8adfbe2e7d3f12395b4caa.tar.gz
VeraCrypt-ce76957a10070c132a8adfbe2e7d3f12395b4caa.zip
Windows: Fix various issues detected by static analysis.
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/BootEncryption.cpp9
-rw-r--r--src/Common/XZip.cpp2
2 files changed, 7 insertions, 4 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";
diff --git a/src/Common/XZip.cpp b/src/Common/XZip.cpp
index 9ce6de5d..be6d27ef 100644
--- a/src/Common/XZip.cpp
+++ b/src/Common/XZip.cpp
@@ -686,7 +686,7 @@ typedef struct zlist {
char iname[MAX_PATH]; // Internal file name after cleanup
char zname[MAX_PATH]; // External version of internal name
int mark; // Marker for files to operate on
- int trash; // Marker for files to delete
+ // int trash; // Marker for files to delete
int dosflag; // Set to force MSDOS file attributes
struct zlist far *nxt; // Pointer to next header in list
} TZipFileInfo;