1
0
mirror of https://github.com/pbatard/rufus.git synced 2026-10-24 02:28:58 +03:00

[misc] fix multiple small issues

* Use the actual Bled latest to fix a potential crash in ZSTD decompression as well as wrong disk size computation.
* Fix wrong parenthesis placement for projected vs actual disk size check.
* Update GitHub Actions to latest. Closes #3000.
This commit is contained in:
Pete Batard
2026-06-22 18:15:06 +01:00
parent 2b5b6d2d7c
commit eedeaea75f
9 changed files with 27 additions and 28 deletions

View File

@@ -41,7 +41,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Initialize CodeQL
uses: github/codeql-action/init@v4

View File

@@ -28,7 +28,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive

View File

@@ -54,7 +54,7 @@ jobs:
upx
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive

View File

@@ -19,7 +19,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v3

View File

@@ -40,7 +40,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive

View File

@@ -727,25 +727,24 @@ int64_t get_uncompressed_size_from_disk_image(int fd, int type)
size = DECOMP_SIZE_UNKNOWN;
goto out;
}
if (buf[0x1c2] == 0xee) {
/* Protective EFI MBR => look for the primary GPT, which'll also give us the sector size */
if (memcmp("EFI PART", &buf[0x200], 8) == 0) {
/* The address of the backup GPT is assumed to be the last LBA for the disk */
size = get_le64(&buf[0x220]) * 512;
goto out;
}
if (memcmp("EFI PART", &buf[0x1000], 8) == 0) {
size = get_le64(&buf[0x1020]) * 8192;
goto out;
}
}
if (buf[0x1be] == 0x80) {
if (buf[0x1be] == 0x00 && buf[0x1c2] == 0xee) {
/*
* Protective EFI MBR => look for the primary GPT, which'll also give us the sector size
* The address of the backup GPT is assumed to be the last LBA for the disk
*/
if (memcmp("EFI PART", &buf[0x200], 8) == 0)
size = (get_le64(&buf[0x220]) + 1) * 512;
else if (memcmp("EFI PART", &buf[0x1000], 8) == 0)
size = (get_le64(&buf[0x1020]) + 1) * 4096;
else
bb_error_msg("Could not locate primary GPT");
} else if (buf[0x1be] == 0x80) {
/* Regular bootable MBR => compute the max LBA (using primary partitions only) */
uint32_t max_lba = 1;
for (int i = 0; i < 4; i++)
max_lba = MAX(max_lba, get_le32(&buf[0x1be + 0x10 * i + 8]) + get_le32(&buf[0x1be + 0x10 * i + 0xc]));
size = max_lba * 512; /* assume 512-byte sectors for anything MBR based */
if (size < 8192)
size = (max_lba + 1) * 512; /* assume 512-byte sectors for anything MBR based */
if (size < 4096)
size = DECOMP_SIZE_UNKNOWN;
}

View File

@@ -119,8 +119,8 @@ unpack_zstd_stream_inner(transformer_state_t *xstate,
IF_DESKTOP(long long) int FAST_FUNC
unpack_zstd_stream(transformer_state_t *xstate)
{
const size_t in_allocsize = roundupsize(ZSTD_DStreamInSize(), 1024),
out_allocsize = roundupsize(ZSTD_DStreamOutSize(), 1024);
const size_t in_allocsize = roundupsize(ZSTD_DStreamInSize(), SECTOR_ALIGNMENT),
out_allocsize = roundupsize(ZSTD_DStreamOutSize(), SECTOR_ALIGNMENT);
IF_DESKTOP(long long) int result;
void *out_buff;

View File

@@ -1528,7 +1528,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
goto out;
}
/* Add 4 KB extra margin for VHD footers and so on */
if ((size_check) && (img_report.projected_size > (uint64_t)SelectedDrive.DiskSize) + 4 * KB) {
if ((size_check) && (img_report.projected_size > ((uint64_t)SelectedDrive.DiskSize + 4 * KB))) {
// This ISO image is too big for the selected target
Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_088), lmprintf(MSG_089));
goto out;

View File

@@ -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 4.15.2394"
CAPTION "Rufus 4.15.2395"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@@ -409,8 +409,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,15,2394,0
PRODUCTVERSION 4,15,2394,0
FILEVERSION 4,15,2395,0
PRODUCTVERSION 4,15,2395,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -428,13 +428,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "4.15.2394"
VALUE "FileVersion", "4.15.2395"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2026 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-4.15.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "4.15.2394"
VALUE "ProductVersion", "4.15.2395"
END
END
BLOCK "VarFileInfo"