From 083b3db34c78d0fd217feccb1962b9136ccdcfa1 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 28 Apr 2020 18:34:45 +0100 Subject: [PATCH] [ext2fs] check for the maximum ext2/ext3 volume size * Suggested by Marcos Mello * Closes #1524 --- src/format_ext.c | 8 ++++++++ src/rufus.rc | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/format_ext.c b/src/format_ext.c index b80cec3a..c7984a99 100644 --- a/src/format_ext.c +++ b/src/format_ext.c @@ -312,6 +312,14 @@ BOOL FormatExtFs(DWORD DriveIndex, uint64_t PartitionOffset, DWORD BlockSize, LP features.s_log_cluster_size = features.s_log_block_size; size /= BlockSize; + // ext2 and ext3 have a can only accomodate up to Blocksize * 2^32 sized volumes + if (((strcmp(FSName, FileSystemLabel[FS_EXT2]) == 0) || (strcmp(FSName, FileSystemLabel[FS_EXT3]) == 0)) && + (size >= 0x100000000ULL)) { + FormatStatus = ext2_last_winerror(ERROR_INVALID_VOLUME_SIZE); + uprintf("Volume size is too large for ext2 or ext3"); + goto out; + } + // Set the blocks, reserved blocks and inodes ext2fs_blocks_count_set(&features, size); ext2fs_r_blocks_count_set(&features, (blk64_t)(reserve_ratio * size)); diff --git a/src/rufus.rc b/src/rufus.rc index 1e737ad3..cd0462be 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 232, 326 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 3.10.1650" +CAPTION "Rufus 3.10.1651" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -395,8 +395,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,10,1650,0 - PRODUCTVERSION 3,10,1650,0 + FILEVERSION 3,10,1651,0 + PRODUCTVERSION 3,10,1651,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -414,13 +414,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.10.1650" + VALUE "FileVersion", "3.10.1651" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.10.1650" + VALUE "ProductVersion", "3.10.1651" END END BLOCK "VarFileInfo"