From c1d670fd752b96abac09b919d7ca1bff4ebafcbc Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 10 Feb 2020 00:21:15 +0100 Subject: Windows: Fix warnings reported by Coverity static code analyzer --- src/Mount/Mount.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Mount') 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) { -- cgit v1.2.3