diff --git a/src/iso.c b/src/iso.c index 5a52be87b6..9a9f65f26f 100644 --- a/src/iso.c +++ b/src/iso.c @@ -1233,18 +1233,9 @@ BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan) char isolinux_tmp[MAX_PATH]; static_sprintf(isolinux_tmp, "%sisolinux.tmp", temp_dir); size = (size_t)ExtractISOFile(src_iso, isolinux_path.String[i], isolinux_tmp, FILE_ATTRIBUTE_NORMAL); - if (size == 0) { + if ((size == 0) || (read_file(isolinux_tmp, &buf) != size)) { uprintf(" Could not access %s", isolinux_path.String[i]); } else { - buf = (char*)calloc(size, 1); - if (buf == NULL) break; - fd = fopen(isolinux_tmp, "rb"); - if (fd == NULL) { - free(buf); - continue; - } - fread(buf, 1, size, fd); - fclose(fd); sl_version = GetSyslinuxVersion(buf, size, &ext); if (img_report.sl_version == 0) { static_strcpy(img_report.sl_version_ext, ext); @@ -1315,15 +1306,10 @@ BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan) // coverity[swapped_arguments] if (GetTempFileNameU(temp_dir, APPLICATION_NAME, 0, path) != 0) { size = (size_t)ExtractISOFile(src_iso, grub_path, path, FILE_ATTRIBUTE_NORMAL); - buf = (char*)calloc(size, 1); - fd = fopen(path, "rb"); - if ((size == 0) || (buf == NULL) || (fd == NULL)) { + if ((size == 0) || (read_file(path, &buf) != size)) uprintf(" Could not read Grub version from '%s'", grub_path); - } else { - fread(buf, 1, size, fd); - fclose(fd); + else GetGrubVersion(buf, size); - } free(buf); DeleteFileU(path); } diff --git a/src/rufus.c b/src/rufus.c index e8035da120..82b0f6ef11 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -2032,7 +2032,7 @@ static void InitDialog(HWND hDlg) len = 0; buf = (char*)GetResource(hMainInstance, resource[i], _RT_RCDATA, "ldlinux_sys", &len, TRUE); if (buf == NULL) { - uprintf("Warning: could not read embedded Syslinux v%d version", i+4); + uprintf("Warning: could not read embedded Syslinux v%d version", i + 4); } else { embedded_sl_version[i] = GetSyslinuxVersion(buf, len, &ext); static_sprintf(embedded_sl_version_str[i], "%d.%02d", SL_MAJOR(embedded_sl_version[i]), SL_MINOR(embedded_sl_version[i])); diff --git a/src/rufus.rc b/src/rufus.rc index 68fc337323..0f7dfeab1a 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 4.5.2127" +CAPTION "Rufus 4.5.2128" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,2127,0 - PRODUCTVERSION 4,5,2127,0 + FILEVERSION 4,5,2128,0 + PRODUCTVERSION 4,5,2128,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.5.2127" + VALUE "FileVersion", "4.5.2128" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.5.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.5.2127" + VALUE "ProductVersion", "4.5.2128" END END BLOCK "VarFileInfo" diff --git a/src/syslinux.c b/src/syslinux.c index f798894bde..ea728c8ad7 100644 --- a/src/syslinux.c +++ b/src/syslinux.c @@ -411,28 +411,30 @@ uint16_t GetSyslinuxVersion(char* buf, size_t buf_size, char** ext) return 0; // Start at 64 to avoid the short incomplete version at the beginning of ldlinux.sys - for (i=64; i= 4) { p[j] = '/'; p = &p[j]; } - for (j=safe_strlen(p)-1; j>0; j--) { + for (j = safe_strlen(p) - 1; j > 0; j--) { // Arch Linux affixes a star for their version - who knows what else is out there... if ((p[j] == ' ') || (p[j] == '*')) p[j] = 0; @@ -440,15 +442,15 @@ uint16_t GetSyslinuxVersion(char* buf, size_t buf_size, char** ext) break; } // Sanitize the string - for (j=1; j