VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Dlgcode.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-09-19 23:31:36 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-09-26 17:43:43 +0200
commit6b3a26bc407ea66ec30130a271868f185f6aa36e (patch)
tree7aeb1773754791c5801cf04f2ffa52f7cc6ca2f4 /src/Common/Dlgcode.c
parente8ea23e71919182c3c9f38c7e444e012d263610a (diff)
downloadVeraCrypt-6b3a26bc407ea66ec30130a271868f185f6aa36e.tar.gz
VeraCrypt-6b3a26bc407ea66ec30130a271868f185f6aa36e.zip
Windows: Add extra check in GetDiskDeviceDriveLetter for code clarity
Diffstat (limited to 'src/Common/Dlgcode.c')
-rw-r--r--src/Common/Dlgcode.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index a5bad787..01f1bc67 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -7346,10 +7346,12 @@ int GetDiskDeviceDriveLetter (PWSTR deviceName)
StringCchCopyW (link, MAX_PATH, L"\\DosDevices\\");
StringCchCatW (link, MAX_PATH, drive);
- ResolveSymbolicLink (link, target, sizeof(target));
-
- if (wcscmp (device, target) == 0)
+ if ( ResolveSymbolicLink (link, target, sizeof(target))
+ && (wcscmp (device, target) == 0)
+ )
+ {
return i;
+ }
}
return -1;