[core] add an exception for JMicron flash drives

* Also fix another round of Coverity trigger-happy warnings (Seriously, those FALSE
  POSITIVES about fwprintf can £$%^&* off — fix your frigging detection, Synopsys!)
This commit is contained in:
Pete Batard 2019-08-05 20:18:34 +01:00
parent fcb15ab6e9
commit 84427d12dd
No known key found for this signature in database
GPG Key ID: 38E0CF5E69EDD671
7 changed files with 20 additions and 13 deletions

View File

@ -216,7 +216,7 @@ static BOOL ExtractFAT(int entry, const char* path)
uprintf("invalid path supplied for MS-DOS FAT extraction\n");
return FALSE;
}
strcpy(filename, path);
static_strcpy(filename, path);
pos = strlen(path);
fnamepos = pos;

View File

@ -293,6 +293,10 @@ retry:
ext2fs_has_feature_64bit(super) ?
EXT2_MIN_DESC_SIZE_64BIT : 0);
if (EXT2_DESC_SIZE(super) == 0) {
retval = EXT2_ET_UNEXPECTED_BLOCK_SIZE;
goto cleanup;
}
fs->desc_blocks = ext2fs_div_ceil(fs->group_desc_count,
EXT2_DESC_PER_BLOCK(super));

View File

@ -280,7 +280,9 @@ static vidpid_score_t vidpid_score[] = {
{ 0x0930, 0x6544, -20 },
{ 0x0930, 0x6545, -20 },
// Innostor exceptions
{ 0x0BC2, 0x03312, -20 },
{ 0x0bc2, 0x3312, -20 },
// JMicron exceptions
{ 0x152d, 0x0901, -20 },
// Verbatim exceptions
{ 0x18a5, 0x0243, -20 },
{ 0x18a5, 0x0245, -20 },

View File

@ -177,8 +177,8 @@ BOOL SetAutorun(const char* path)
GetWindowTextW(hLabel, wlabel, ARRAYSIZE(wlabel));
GetWindowTextW(hMainDialog, wRufusVersion, ARRAYSIZE(wRufusVersion));
fwprintf(fd, L"; Created by %s\n; " LTEXT(RUFUS_URL) L"\n", wRufusVersion);
fwprintf(fd, L"[autorun]\nicon = autorun.ico\nlabel = %s\n", wlabel);
fwprintf_s(fd, L"; Created by %s\n; " LTEXT(RUFUS_URL) L"\n", wRufusVersion);
fwprintf_s(fd, L"[autorun]\nicon = autorun.ico\nlabel = %s\n", wlabel);
fclose(fd);
uprintf("Created: %s", filename);

View File

@ -336,6 +336,7 @@ static __inline int GetWindowTextU(HWND hWnd, char* lpString, int nMaxCount)
walloc(lpString, nMaxCount);
ret = GetWindowTextW(hWnd, wlpString, nMaxCount);
err = GetLastError();
// coverity[var_deref_model]
if ( (ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpString, lpString, nMaxCount)) == 0) ) {
err = GetLastError();
}

View File

@ -782,13 +782,13 @@ char* set_token_data_file(const char* token, const char* data, const char* filen
fputws(buf, fd_out);
// Now output the new data
fwprintf(fd_out, L"%s\n", wdata);
fwprintf_s(fd_out, L"%s\n", wdata);
ret = (char*)data;
}
if (ret == NULL) {
// Didn't find an existing token => append it
fwprintf(fd_out, L"%s = %s\n", wtoken, wdata);
fwprintf_s(fd_out, L"%s = %s\n", wtoken, wdata);
ret = (char*)data;
}
@ -1039,7 +1039,7 @@ char* insert_section_data(const char* filename, const char* section, const char*
// Section was found, output it
fputws(buf, fd_out);
// Now output the new data
fwprintf(fd_out, L"%s\n", wdata);
fwprintf_s(fd_out, L"%s\n", wdata);
ret = (char*)data;
}
@ -1194,7 +1194,7 @@ char* replace_in_token_data(const char* filename, const char* token, const char*
i = (torep-buf) + wcslen(wsrc);
*torep = 0;
fwprintf(fd_out, L"%s%s%s", buf, wrep, &buf[i]);
fwprintf_s(fd_out, L"%s%s%s", buf, wrep, &buf[i]);
ret = (char*)rep;
}

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 3.7.1555"
CAPTION "Rufus 3.7.1556"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -394,8 +394,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,7,1555,0
PRODUCTVERSION 3,7,1555,0
FILEVERSION 3,7,1556,0
PRODUCTVERSION 3,7,1556,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -413,13 +413,13 @@ BEGIN
VALUE "Comments", "https://akeo.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.7.1555"
VALUE "FileVersion", "3.7.1556"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus-3.7.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.7.1555"
VALUE "ProductVersion", "3.7.1556"
END
END
BLOCK "VarFileInfo"