VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format/InPlace.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2022-03-26 20:03:19 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2022-03-26 21:15:11 +0100
commit762065917f3ac47c3bdcacdb608d35b36dfb3973 (patch)
tree7863397c35f5e560c28150879307acec6c18b3d2 /src/Format/InPlace.c
parenta0809fe85c2f1bf130c26ff77aea7dac19b6c05f (diff)
downloadVeraCrypt-762065917f3ac47c3bdcacdb608d35b36dfb3973.tar.gz
VeraCrypt-762065917f3ac47c3bdcacdb608d35b36dfb3973.zip
Windows: Add various checks to address Coverity reported issues.
Diffstat (limited to 'src/Format/InPlace.c')
-rw-r--r--src/Format/InPlace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Format/InPlace.c b/src/Format/InPlace.c
index 4a16fd4f..f6166dab 100644
--- a/src/Format/InPlace.c
+++ b/src/Format/InPlace.c
@@ -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
)
{