VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Core/Unix/CoreUnix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core/Unix/CoreUnix.cpp')
-rw-r--r--src/Core/Unix/CoreUnix.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Core/Unix/CoreUnix.cpp b/src/Core/Unix/CoreUnix.cpp
index 372c450..a648520 100644
--- a/src/Core/Unix/CoreUnix.cpp
+++ b/src/Core/Unix/CoreUnix.cpp
@@ -465,6 +465,7 @@ namespace VeraCrypt
continue;
}
+ options.Password.reset();
throw;
}
@@ -473,8 +474,10 @@ namespace VeraCrypt
if (options.Path->IsDevice())
{
- if (volume->GetFile()->GetDeviceSectorSize() != volume->GetSectorSize())
- throw ParameterIncorrect (SRC_POS);
+ const uint32 devSectorSize = volume->GetFile()->GetDeviceSectorSize();
+ const size_t volSectorSize = volume->GetSectorSize();
+ if (devSectorSize != volSectorSize)
+ throw DeviceSectorSizeMismatch (SRC_POS, StringConverter::ToWide(devSectorSize) + L" != " + StringConverter::ToWide((uint32) volSectorSize));
}
// Find a free mount point for FUSE service