mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-06 00:56:35 -05:00
Windows: Add extra check in GetDiskDeviceDriveLetter for code clarity
This commit is contained in:
1 parent
e8ea23e719
commit
6b3a26bc40
1 file changed
+5
-3
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user