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

Windows:Fix various issues and warnings reported by static code analysis tool Coverity.

This commit is contained in:
Mounir IDRASSI
2016-02-07 02:07:38 +01:00
parent 229bd668f4
commit ae7ec4802a
22 changed files with 175 additions and 115 deletions

View File

@@ -414,7 +414,7 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
dataAreaSize = GetVolumeDataAreaSize (volParams->hiddenVol, deviceSize);
StringCbCopyW (deviceName, sizeof(deviceName), volParams->volumePath);
StringCchCopyW (deviceName, ARRAYSIZE(deviceName), volParams->volumePath);
driveLetter = GetDiskDeviceDriveLetter (deviceName);
@@ -1284,6 +1284,16 @@ int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile
goto closing_seq;
}
if ( (driveGeometry.BytesPerSector == 0)
|| (driveGeometry.BytesPerSector > TC_MAX_VOLUME_SECTOR_SIZE)
|| (driveGeometry.BytesPerSector % ENCRYPTION_DATA_UNIT_SIZE != 0)
)
{
Error ("SECTOR_SIZE_UNSUPPORTED", hwndDlg);
nStatus = ERR_DONT_REPORT;
goto closing_seq;
}
sectorSize = driveGeometry.BytesPerSector;