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:
@@ -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
|
||||
)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user