VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount/Mount.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-02-10 00:21:15 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-02-10 02:23:18 +0100
commitc1d670fd752b96abac09b919d7ca1bff4ebafcbc (patch)
tree27c927e9dc15e6d528aa3475b653bd0381031b83 /src/Mount/Mount.c
parenta7b61ce5e5a0d0d5ab2814d59e832c169e1b845f (diff)
downloadVeraCrypt-c1d670fd752b96abac09b919d7ca1bff4ebafcbc.tar.gz
VeraCrypt-c1d670fd752b96abac09b919d7ca1bff4ebafcbc.zip
Windows: Fix warnings reported by Coverity static code analyzer
Diffstat (limited to 'src/Mount/Mount.c')
-rw-r--r--src/Mount/Mount.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index c95129f6..ca322280 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -5157,7 +5157,14 @@ static BOOL Dismount (HWND hwndDlg, int nDosDriveNo)
WaitCursor ();
if (nDosDriveNo == -2)
+ {
nDosDriveNo = (char) (HIWORD (GetSelectedLong (GetDlgItem (hwndDlg, IDC_DRIVELIST))) - L'A');
+ if (nDosDriveNo < 0 || nDosDriveNo >= 26)
+ {
+ NormalCursor ();
+ return FALSE;
+ }
+ }
if (bCloseDismountedWindows)
{