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

Windows: Add various checks to address Coverity reported issues.

This commit is contained in:
Mounir IDRASSI
2022-03-26 20:03:19 +01:00
parent a0809fe85c
commit 762065917f
11 changed files with 105 additions and 28 deletions

View File

@@ -89,6 +89,8 @@ static __int64 NewFileSysSizeAfterShrink (HANDLE dev, const wchar_t *devicePath,
}
if ( (ntfsVolData.NumberSectors.QuadPart <= 0)
|| (ntfsVolData.BytesPerSector == 0)
|| (ntfsVolData.BytesPerSector >= (DWORD) UINT_MAX)
|| (ntfsVolData.NumberSectors.QuadPart > (INT64_MAX / (__int64) ntfsVolData.BytesPerSector)) // overflow test
)
{