From 762065917f3ac47c3bdcacdb608d35b36dfb3973 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sat, 26 Mar 2022 20:03:19 +0100 Subject: Windows: Add various checks to address Coverity reported issues. --- src/ExpandVolume/ExpandVolume.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ExpandVolume') 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 -- cgit v1.2.3