diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2022-03-26 20:03:19 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2022-03-26 21:15:11 +0100 |
commit | 762065917f3ac47c3bdcacdb608d35b36dfb3973 (patch) | |
tree | 7863397c35f5e560c28150879307acec6c18b3d2 /src/ExpandVolume | |
parent | a0809fe85c2f1bf130c26ff77aea7dac19b6c05f (diff) | |
download | VeraCrypt-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.c | 6 |
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 |