mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-06-17 10:06:06 -05:00
Fix hidden volume size estimate for exFAT outer volumes
On Unix and macOS, the hidden volume wizard estimates the available space for non-FAT outer filesystems using statvfs(). The previous calculation used f_bsize with f_bavail, which can overstate available bytes on macOS exFAT because f_bsize may be the preferred I/O size instead of the fragment size associated with the block counts. Use f_frsize when it is reported, fall back to f_bsize, and clamp the non-FAT estimate to the actual outer VeraCrypt data size before applying the existing 80% safety heuristic. Also harden hidden volume creation in both the cross-platform VolumeCreator path and the Windows/common formatting path by rejecting sizes that would exceed the hidden host data area and overlap volume header space. Fixes #1037
This commit is contained in:
@@ -301,6 +301,10 @@ namespace VeraCrypt
|
||||
|
||||
if (HostSize < TC_MIN_HIDDEN_VOLUME_HOST_SIZE)
|
||||
throw ParameterIncorrect (SRC_POS);
|
||||
|
||||
if (HostSize <= TC_TOTAL_VOLUME_HEADERS_SIZE
|
||||
|| options->Size > HostSize - TC_TOTAL_VOLUME_HEADERS_SIZE)
|
||||
throw ParameterIncorrect (SRC_POS);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user