Compare commits

...

2 Commits

Author SHA1 Message Date
Pete Batard 180a61736c
[misc] move the revoked UEFI bootloader prompt before the ISO → ESP one
* Also fix a potential buffer overflow when displaying the detailed HDD vs UFD score due to the
  safe_sprintf() macro re-evaluating the expression passed as parameter.
* Also refactor and clean up the the safe_###() macros to avoid similar issues.
* Also use FOF_NO_UI as flag for SHDeleteDirectoryExU(), which may alleviate some Alt-D errors.
2024-05-06 19:47:36 +01:00
Pete Batard 2106be0c3b
[iso] fix an assertion with mt86plus_7.00_64.grub.iso
* Also fix a couple typos in Brazilian Portuguese translation.
2024-05-06 19:39:26 +01:00
6 changed files with 44 additions and 42 deletions

View File

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: 4.5\n"
"Report-Msgid-Bugs-To: pete@akeo.ie\n"
"POT-Creation-Date: 2024-05-01 14:24-0300\n"
"PO-Revision-Date: 2024-05-01 16:45-0300\n"
"PO-Revision-Date: 2024-05-04 12:06+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: pt_BR\n"
@ -1853,7 +1853,7 @@ msgid ""
"Note: The file will be downloaded in the application's directory and will be reused automatically if present."
msgstr ""
"Um arquivo adicional ('diskcopy.dll') precisa ser baixado da Microsoft para instalar o MS-DOS:\n"
"- Selecione 'Sim\" para se conectar à Internet e baixá-lo\n"
"- Selecione 'Sim' para se conectar à Internet e baixá-lo\n"
"- Selecione 'Não' para cancelar a operação\n"
"\n"
"Nota: O arquivo será baixado no diretório da aplicação e será reutilizado automaticamente caso presente."
@ -1901,7 +1901,7 @@ msgid ""
"- Select 'No' to cancel the operation"
msgstr ""
"Alguns dados adicionais precisam ser baixados da Microsoft para usar essa funcionalidade:\n"
"- Selecione 'Sim\" para se conectar à Internet e baixá-los\n"
"- Selecione 'Sim' para se conectar à Internet e baixá-los\n"
"- Selecione 'Não' para cancelar a operação"
#. • MSG_346

View File

@ -3,7 +3,7 @@
#########################################################################
# List of all languages included in this file (with version)
# • v4.5 "en-US" "English (English)"
# • v4.5 "en-US" "English (English)"
# • v4.5 "ar-SA" "Arabic (العربية)"
# • v3.22 "bg-BG" "Bulgarian (Български)"
# • v4.5 "zh-CN" "Chinese Simplified (简体中文)"
@ -10917,7 +10917,7 @@ t MSG_333 "Criar uma conta local com nome de usuário:"
t MSG_334 "Definir as opções regionais com os mesmos valores deste usuário"
t MSG_335 "Desativar a encriptação automática BitLocker"
t MSG_336 "Registo persistente"
t MSG_337 "Um arquivo adicional ('diskcopy.dll') precisa ser baixado da Microsoft para instalar o MS-DOS:\n- Selecione 'Sim\" para se conectar à Internet e baixá-lo\n- Selecione 'Não' para cancelar a operação\n\nNota: O arquivo será baixado no diretório da aplicação e será reutilizado automaticamente caso presente."
t MSG_337 "Um arquivo adicional ('diskcopy.dll') precisa ser baixado da Microsoft para instalar o MS-DOS:\n- Selecione 'Sim' para se conectar à Internet e baixá-lo\n- Selecione 'Não' para cancelar a operação\n\nNota: O arquivo será baixado no diretório da aplicação e será reutilizado automaticamente caso presente."
t MSG_338 "Detectado carregador de inicialização UEFI revogado"
t MSG_339 "Rufus detectou que o ISO selecionado contém um carregador de inicialização UEFI que foi revogado e produzirá %s quando Secure Boot estiver habilitado em um sistema UEFI atualizado.\n\n- Se você obteve essa imagem ISO de uma fonte não confiável, você deve considerar a possibilidade da mesma conter malware UEFI e evitar inicializar através dela.\n- Se você a obteve de uma fonte confiável, você deve tentar achar uma versão mais recente, que não produza este aviso."
t MSG_340 "uma tela \"Security Violation\""
@ -10925,7 +10925,7 @@ t MSG_341 "uma tela de Reparo do Windows (BSOD) com '%s'"
t MSG_342 "Imagem VHDX comprimida"
t MSG_343 "Imagem VHD não comprimida"
t MSG_344 "Imagem Full Flash Update"
t MSG_345 "Alguns dados adicionais precisam ser baixados da Microsoft para usar essa funcionalidade:\n- Selecione 'Sim\" para se conectar à Internet e baixá-los\n- Selecione 'Não' para cancelar a operação"
t MSG_345 "Alguns dados adicionais precisam ser baixados da Microsoft para usar essa funcionalidade:\n- Selecione 'Sim' para se conectar à Internet e baixá-los\n- Selecione 'Não' para cancelar a operação"
t MSG_346 "Restringir Windows ao modo S (INCOMPATÍVEL com remoção de exigência de conta online)"
t MSG_347 "Modo Especialista"
t MSG_348 "Extraindo arquivos: %s"

View File

@ -552,7 +552,7 @@ iso9660_ifs_read_superblock (iso9660_t *p_iso,
if (p_iso->boot_img[j].lsn == 0)
continue;
/* Find the closest LSN after the one from this image */
cdio_assert(p_iso->boot_img[j].lsn < next_lsn);
cdio_assert(p_iso->boot_img[j].lsn <= next_lsn);
for (k = 0; k < MAX_BOOT_IMAGES; k++) {
if (p_iso->boot_img[k].lsn > p_iso->boot_img[j].lsn &&
p_iso->boot_img[k].lsn < next_lsn)

View File

@ -1605,18 +1605,6 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
}
}
if ((img_report.projected_size < MAX_ISO_TO_ESP_SIZE * MB) && HAS_REGULAR_EFI(img_report) &&
(partition_type == PARTITION_STYLE_GPT) && IS_FAT(fs_type) && !esp_already_asked) {
// The ISO is small enough to be written as an ESP and we are using GPT
// so ask the users if they want to write it as an ESP.
char* iso_image = lmprintf(MSG_036);
char* choices[2] = { lmprintf(MSG_276, iso_image), lmprintf(MSG_277, "ISO → ESP") };
i = SelectionDialog(lmprintf(MSG_274, "ESP"), lmprintf(MSG_310), choices, 2);
if (i < 0) // Cancel
goto out;
write_as_esp = (i & 2);
}
// Check UEFI bootloaders for revocation
if (IS_EFI_BOOTABLE(img_report)) {
// coverity[swapped_arguments]
@ -1642,6 +1630,18 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
}
}
if ((img_report.projected_size < MAX_ISO_TO_ESP_SIZE * MB) && HAS_REGULAR_EFI(img_report) &&
(partition_type == PARTITION_STYLE_GPT) && IS_FAT(fs_type) && !esp_already_asked) {
// The ISO is small enough to be written as an ESP and we are using GPT
// so ask the users if they want to write it as an ESP.
char* iso_image = lmprintf(MSG_036);
char* choices[2] = { lmprintf(MSG_276, iso_image), lmprintf(MSG_277, "ISO → ESP") };
i = SelectionDialog(lmprintf(MSG_274, "ESP"), lmprintf(MSG_310), choices, 2);
if (i < 0) // Cancel
goto out;
write_as_esp = (i & 2);
}
// If the selected target doesn't include BIOS, skip file downloads for GRUB/Syslinux
if (target_type != TT_BIOS)
goto uefi_target;
@ -3823,7 +3823,7 @@ extern int TestHashes(void);
if ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'D')) {
static_sprintf(tmp_path, "%s\\%s", app_data_dir, FILES_DIR);
PrintStatusDebug(STATUS_MSG_TIMEOUT, MSG_264, tmp_path);
SHDeleteDirectoryExU(NULL, tmp_path, FOF_SILENT | FOF_NOERRORUI | FOF_NOCONFIRMATION);
SHDeleteDirectoryExU(NULL, tmp_path, FOF_NO_UI);
user_deleted_rufus_dir = TRUE;
continue;
}

View File

@ -147,27 +147,29 @@
#define ComboBox_GetCurItemData(hCtrl) ComboBox_GetItemData(hCtrl, ComboBox_GetCurSel(hCtrl))
#define safe_free(p) do {free((void*)p); p = NULL;} while(0)
#define safe_mm_free(p) do {_mm_free((void*)p); p = NULL;} while(0)
#define safe_min(a, b) min((size_t)(a), (size_t)(b))
#define safe_strcp(dst, dst_max, src, count) do { size_t _count = (count); memmove(dst, src, safe_min(_count, dst_max)); \
((char*)(dst))[safe_min(_count, dst_max)-1] = 0; } while(0)
#define safe_strcpy(dst, dst_max, src) safe_strcp(dst, dst_max, src, safe_strlen(src)+1)
#define safe_free(p) do { free((void*)p); p = NULL; } while(0)
#define safe_mm_free(p) do { _mm_free((void*)p); p = NULL; } while(0)
static __inline void safe_strcp(char* dst, const size_t dst_max, const char* src, const size_t count) {
memmove(dst, src, min(count, dst_max));
dst[min(count, dst_max) - 1] = 0;
}
#define safe_strcpy(dst, dst_max, src) safe_strcp(dst, dst_max, src, safe_strlen(src) + 1)
#define static_strcpy(dst, src) safe_strcpy(dst, sizeof(dst), src)
#define safe_strcat(dst, dst_max, src) strncat_s(dst, dst_max, src, _TRUNCATE)
#define static_strcat(dst, src) safe_strcat(dst, sizeof(dst), src)
#define safe_strcmp(str1, str2) strcmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2))
#define safe_strstr(str1, str2) strstr(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2))
#define safe_stricmp(str1, str2) _stricmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2))
#define safe_strncmp(str1, str2, count) strncmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2), count)
#define safe_strnicmp(str1, str2, count) _strnicmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2), count)
#define safe_closehandle(h) do {if ((h != INVALID_HANDLE_VALUE) && (h != NULL)) {CloseHandle(h); h = INVALID_HANDLE_VALUE;}} while(0)
#define safe_release_dc(hDlg, hDC) do {if ((hDC != INVALID_HANDLE_VALUE) && (hDC != NULL)) {ReleaseDC(hDlg, hDC); hDC = NULL;}} while(0)
#define safe_sprintf(dst, count, ...) do { size_t _count = (count); _snprintf_s(dst, _count, _TRUNCATE, __VA_ARGS__); (dst)[(_count)-1] = 0; } while(0)
#define safe_strcmp(str1, str2) strcmp(((str1 == NULL) ? "<NULL>" : str1), ((str2 == NULL) ? "<NULL>" : str2))
#define safe_strstr(str1, str2) strstr(((str1 == NULL) ? "<NULL>" : str1), ((str2 == NULL) ? "<NULL>" : str2))
#define safe_stricmp(str1, str2) _stricmp(((str1 == NULL) ? "<NULL>" : str1), ((str2 == NULL) ? "<NULL>" : str2))
#define safe_strncmp(str1, str2, count) strncmp(((str1 == NULL) ? "<NULL>" : str1), ((str2 == NULL) ? "<NULL>" : str2), count)
#define safe_strnicmp(str1, str2, count) _strnicmp(((str1 == NULL) ? "<NULL>" : str1), ((str2 == NULL) ? "<NULL>" : str2), count)
#define safe_closehandle(h) do { if ((h != INVALID_HANDLE_VALUE) && (h != NULL)) { CloseHandle(h); h = INVALID_HANDLE_VALUE; } } while(0)
#define safe_release_dc(hDlg, hDC) do { if ((hDC != INVALID_HANDLE_VALUE) && (hDC != NULL)) { ReleaseDC(hDlg, hDC); hDC = NULL; } } while(0)
#define safe_sprintf(dst, count, ...) do { size_t _count = count; char* _dst = dst; _snprintf_s(_dst, _count, _TRUNCATE, __VA_ARGS__); \
_dst[(_count) - 1] = 0; } while(0)
#define static_sprintf(dst, ...) safe_sprintf(dst, sizeof(dst), __VA_ARGS__)
#define safe_atoi(str) ((((char*)(str))==NULL)?0:atoi(str))
#define safe_strlen(str) ((((char*)(str))==NULL)?0:strlen(str))
#define safe_strdup(str) ((((char*)(str))==NULL)?NULL:_strdup(str))
#define safe_atoi(str) ((((char*)(str))==NULL) ? 0 : atoi(str))
#define safe_strlen(str) ((((char*)(str))==NULL) ? 0 : strlen(str))
#define safe_strdup(str) ((((char*)(str))==NULL) ? NULL : _strdup(str))
#if defined(_MSC_VER)
#define safe_vsnprintf(buf, size, format, arg) _vsnprintf_s(buf, size, _TRUNCATE, format, arg)
#else

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.5.2156"
CAPTION "Rufus 4.5.2158"
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,2156,0
PRODUCTVERSION 4,5,2156,0
FILEVERSION 4,5,2158,0
PRODUCTVERSION 4,5,2158,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.2156"
VALUE "FileVersion", "4.5.2158"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "<22> 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.2156"
VALUE "ProductVersion", "4.5.2158"
END
END
BLOCK "VarFileInfo"