VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/ExpandVolume
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/ExpandVolume
parenta0809fe85c2f1bf130c26ff77aea7dac19b6c05f (diff)
downloadVeraCrypt-762065917f3ac47c3bdcacdb608d35b36dfb3973.tar.gz
VeraCrypt-762065917f3ac47c3bdcacdb608d35b36dfb3973.zip
Windows: Add various checks to address Coverity reported issues.
Diffstat (limited to 'src/ExpandVolume')
-rw-r--r--src/ExpandVolume/ExpandVolume.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ExpandVolume/ExpandVolume.c b/src/ExpandVolume/ExpandVolume.c
index 84f6cfe8..f62d93ae 100644
--- a/src/ExpandVolume/ExpandVolume.c
+++ b/src/ExpandVolume/ExpandVolume.c
@@ -442,6 +442,12 @@ int ExtendFileSystem (HWND hwndDlg , wchar_t *lpszVolume, Password *pVolumePassw
goto error;
}
+ if ((BytesPerSector == 0) || (BytesPerSector > (DWORD)INT_MAX))
+ {
+ nStatus = ERR_SECTOR_SIZE_INCOMPATIBLE;
+ goto error;
+ }
+
DebugAddProgressDlgStatus (hwndDlg, L"Extending file system ...\r\n");
// extend volume