VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-16 22:59:21 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-16 23:21:45 +0100
commit3c87c095c31552cc19e68c2c2678453f36476f81 (patch)
treec4bdd7aea0cd8e1c3eeb899673f7cd5b99a3f01e
parent2724d7880d27fb9ff421f894da65158646f80957 (diff)
downloadVeraCrypt-3c87c095c31552cc19e68c2c2678453f36476f81.tar.gz
VeraCrypt-3c87c095c31552cc19e68c2c2678453f36476f81.zip
Windows: use buffer with known maximum length as input to FakeDosNameForDevice
-rw-r--r--src/Format/InPlace.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Format/InPlace.c b/src/Format/InPlace.c
index a6b6abeb..720b9466 100644
--- a/src/Format/InPlace.c
+++ b/src/Format/InPlace.c
@@ -779,9 +779,9 @@ int EncryptPartitionInPlaceResume (HANDLE dev,
if (dev == INVALID_HANDLE_VALUE)
{
- StringCbCopyW (deviceName, sizeof(deviceName), devicePath);
+ StringCchCopyW (deviceName, ARRAYSIZE(deviceName), devicePath);
- if (FakeDosNameForDevice (devicePath, dosDev, sizeof(dosDev),devName, sizeof(devName),FALSE) != 0)
+ if (FakeDosNameForDevice (deviceName, dosDev, sizeof(dosDev),devName, sizeof(devName),FALSE) != 0)
{
nStatus = ERR_OS_ERROR;
goto closing_seq;
@@ -1244,9 +1244,9 @@ int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile
}
- StringCbCopyW (deviceName, sizeof(deviceName), devicePath);
+ StringCchCopyW (deviceName, ARRAYSIZE(deviceName), devicePath);
- if (FakeDosNameForDevice (devicePath, dosDev, sizeof(dosDev), devName, sizeof(devName), FALSE) != 0)
+ if (FakeDosNameForDevice (deviceName, dosDev, sizeof(dosDev), devName, sizeof(devName), FALSE) != 0)
{
nStatus = ERR_OS_ERROR;
goto closing_seq;