VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-02-09 23:21:15 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-02-10 01:23:18 (GMT)
commitc1d670fd752b96abac09b919d7ca1bff4ebafcbc (patch)
tree27c927e9dc15e6d528aa3475b653bd0381031b83 /src/Mount
parenta7b61ce5e5a0d0d5ab2814d59e832c169e1b845f (diff)
downloadVeraCrypt-c1d670fd752b96abac09b919d7ca1bff4ebafcbc.zip
VeraCrypt-c1d670fd752b96abac09b919d7ca1bff4ebafcbc.tar.gz
Windows: Fix warnings reported by Coverity static code analyzer
Diffstat (limited to 'src/Mount')
-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 c95129f..ca32228 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)
{