diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-09-19 23:31:36 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-09-26 17:43:43 +0200 |
commit | 6b3a26bc407ea66ec30130a271868f185f6aa36e (patch) | |
tree | 7aeb1773754791c5801cf04f2ffa52f7cc6ca2f4 /src/Common/Dlgcode.c | |
parent | e8ea23e71919182c3c9f38c7e444e012d263610a (diff) | |
download | VeraCrypt-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.c | 8 |
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;
|