diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2021-08-29 15:23:59 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2021-08-30 00:26:57 +0200 |
commit | fb1a4893b8dff55f5669e935a419ea87b41f62f6 (patch) | |
tree | f4781d18ef50917ec2b323506401d2d54c7e2109 | |
parent | d9e1d57a5323baa821f9962476929b85677ab469 (diff) | |
download | VeraCrypt-fb1a4893b8dff55f5669e935a419ea87b41f62f6.tar.gz VeraCrypt-fb1a4893b8dff55f5669e935a419ea87b41f62f6.zip |
Windows: Fix some VS static analyzed warnings
-rw-r--r-- | src/Common/EncryptionThreadPool.c | 2 | ||||
-rw-r--r-- | src/Crypto/jitterentropy-base.c | 2 | ||||
-rw-r--r-- | src/Driver/DumpFilter.c | 2 | ||||
-rw-r--r-- | src/Driver/Ntdriver.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/Common/EncryptionThreadPool.c b/src/Common/EncryptionThreadPool.c index 3cb6b878..1401e8a0 100644 --- a/src/Common/EncryptionThreadPool.c +++ b/src/Common/EncryptionThreadPool.c @@ -692,7 +692,7 @@ void EncryptionThreadPoolDoWork (EncryptionThreadPoolWorkType type, byte *data, workItem->Encryption.UnitCount = unitsPerFragment; workItem->Encryption.StartUnitNo.Value = fragmentStartUnitNo; - fragmentData += unitsPerFragment * ENCRYPTION_DATA_UNIT_SIZE; + fragmentData += ((uint64)unitsPerFragment) * ENCRYPTION_DATA_UNIT_SIZE; fragmentStartUnitNo += unitsPerFragment; if (remainder > 0 && --remainder == 0) diff --git a/src/Crypto/jitterentropy-base.c b/src/Crypto/jitterentropy-base.c index c25589b0..b7512532 100644 --- a/src/Crypto/jitterentropy-base.c +++ b/src/Crypto/jitterentropy-base.c @@ -345,7 +345,7 @@ static uint64_t jent_loop_shuffle(struct rand_data *ec, * We add a lower boundary value to ensure we have a minimum * RNG loop count. */ - return (shuffle + (1<<min)); + return (shuffle + (1ULL<<min)); } /** diff --git a/src/Driver/DumpFilter.c b/src/Driver/DumpFilter.c index fc1c7d37..725a4fe0 100644 --- a/src/Driver/DumpFilter.c +++ b/src/Driver/DumpFilter.c @@ -127,7 +127,7 @@ NTSTATUS DumpFilterEntry (PFILTER_EXTENSION filterExtension, PFILTER_INITIALIZAT goto err; } - WriteFilterBufferSize = filterInitData->MaxPagesPerWrite * PAGE_SIZE; + WriteFilterBufferSize = ((SIZE_T)filterInitData->MaxPagesPerWrite) * PAGE_SIZE; #ifdef _WIN64 highestAcceptableWriteBufferAddr.QuadPart = 0x7FFffffFFFFLL; diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c index ca840fea..c778cfed 100644 --- a/src/Driver/Ntdriver.c +++ b/src/Driver/Ntdriver.c @@ -4612,7 +4612,7 @@ void EnsureNullTerminatedString (wchar_t *str, size_t maxSizeInBytes) void *AllocateMemoryWithTimeout (size_t size, int retryDelay, int timeout) { LARGE_INTEGER waitInterval; - waitInterval.QuadPart = retryDelay * -10000; + waitInterval.QuadPart = ((LONGLONG)retryDelay) * -10000; ASSERT (KeGetCurrentIrql() <= APC_LEVEL); ASSERT (retryDelay > 0 && retryDelay <= timeout); |