1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-12 03:18:26 -06:00

Windows: use buffer with known maximum length as input to FakeDosNameForDevice

This commit is contained in:
Mounir IDRASSI
2016-02-16 22:59:21 +01:00
parent 2724d7880d
commit 3c87c095c3

View File

@@ -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;