diff options
-rw-r--r-- | src/Common/Volumes.c | 9 | ||||
-rw-r--r-- | src/Driver/DriveFilter.c | 4 | ||||
-rw-r--r-- | src/Driver/Ntdriver.c | 2 | ||||
-rw-r--r-- | src/Driver/Ntvol.c | 4 | ||||
-rw-r--r-- | src/Driver/VolumeFilter.c | 4 |
5 files changed, 14 insertions, 9 deletions
diff --git a/src/Common/Volumes.c b/src/Common/Volumes.c index 53734abb..d3001a94 100644 --- a/src/Common/Volumes.c +++ b/src/Common/Volumes.c @@ -180,9 +180,9 @@ int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int int pkcs5PrfCount = LAST_PRF_ID - FIRST_PRF_ID + 1; #if !defined(_UEFI) TC_EVENT keyDerivationCompletedEvent; TC_EVENT noOutstandingWorkItemEvent; - KeyDerivationWorkItem *keyDerivationWorkItems; + KeyDerivationWorkItem *keyDerivationWorkItems = NULL; KeyDerivationWorkItem *item; size_t encryptionThreadCount = GetEncryptionThreadCount(); LONG outstandingWorkItemCount = 0; int i; @@ -588,10 +588,13 @@ ret: if ((selected_pkcs5_prf == 0) && (encryptionThreadCount > 1)) { TC_WAIT_EVENT (noOutstandingWorkItemEvent); - burn (keyDerivationWorkItems, sizeof (KeyDerivationWorkItem) * pkcs5PrfCount); - TCfree (keyDerivationWorkItems); + if (keyDerivationWorkItems) + { + burn (keyDerivationWorkItems, sizeof (KeyDerivationWorkItem) * pkcs5PrfCount); + TCfree (keyDerivationWorkItems); + } #if !defined(DEVICE_DRIVER) CloseHandle (keyDerivationCompletedEvent); CloseHandle (noOutstandingWorkItemEvent); diff --git a/src/Driver/DriveFilter.c b/src/Driver/DriveFilter.c index a12b1ec0..dc836ebe 100644 --- a/src/Driver/DriveFilter.c +++ b/src/Driver/DriveFilter.c @@ -219,9 +219,9 @@ NTSTATUS LoadBootArguments (BOOL bIsEfi) NTSTATUS DriveFilterAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo) { - DriveFilterExtension *Extension; + DriveFilterExtension *Extension = NULL; NTSTATUS status; PDEVICE_OBJECT filterDeviceObject = NULL; PDEVICE_OBJECT attachedDeviceObject; @@ -274,9 +274,9 @@ NTSTATUS DriveFilterAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo) err: if (filterDeviceObject) { - if (Extension->LowerDeviceObject) + if (Extension && Extension->LowerDeviceObject) IoDetachDevice (Extension->LowerDeviceObject); IoDeleteDevice (filterDeviceObject); } diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c index a05335f2..a5ef2472 100644 --- a/src/Driver/Ntdriver.c +++ b/src/Driver/Ntdriver.c @@ -12,8 +12,10 @@ code distribution packages. */ #include "TCdefs.h" #include <ntddk.h> +#include <initguid.h> +#include <Ntddstor.h> #include "Crypto.h" #include "Fat.h" #include "Tests.h" #include "cpu.h" diff --git a/src/Driver/Ntvol.c b/src/Driver/Ntvol.c index f9e11d3d..747fc026 100644 --- a/src/Driver/Ntvol.c +++ b/src/Driver/Ntvol.c @@ -42,16 +42,16 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject, MOUNT_STRUCT *mount, PWSTR pwszMountVolume, BOOL bRawDevice) { - FILE_STANDARD_INFORMATION FileStandardInfo; + FILE_STANDARD_INFORMATION FileStandardInfo = {0}; FILE_BASIC_INFORMATION FileBasicInfo; OBJECT_ATTRIBUTES oaFileAttributes; UNICODE_STRING FullFileName; IO_STATUS_BLOCK IoStatusBlock; PCRYPTO_INFO cryptoInfoPtr = NULL; PCRYPTO_INFO tmpCryptoInfo = NULL; - LARGE_INTEGER lDiskLength; + LARGE_INTEGER lDiskLength = {0}; __int64 partitionStartingOffset = 0; int volumeType; char *readBuffer = 0; NTSTATUS ntStatus = 0; diff --git a/src/Driver/VolumeFilter.c b/src/Driver/VolumeFilter.c index a3d323be..14e496bc 100644 --- a/src/Driver/VolumeFilter.c +++ b/src/Driver/VolumeFilter.c @@ -24,9 +24,9 @@ uint32 HiddenSysLeakProtectionCount = 0; NTSTATUS VolumeFilterAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo) { - VolumeFilterExtension *Extension; + VolumeFilterExtension *Extension = NULL; NTSTATUS status; PDEVICE_OBJECT filterDeviceObject = NULL; PDEVICE_OBJECT attachedDeviceObject; @@ -71,9 +71,9 @@ NTSTATUS VolumeFilterAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo) err: if (filterDeviceObject) { - if (Extension->LowerDeviceObject) + if (Extension && Extension->LowerDeviceObject) IoDetachDevice (Extension->LowerDeviceObject); IoDeleteDevice (filterDeviceObject); } |