1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[misc] fix some benign Coverity warnings

This commit is contained in:
Pete Batard 2023-06-18 19:09:15 +02:00
parent be5b590cfb
commit 7eb9a6f16b
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
4 changed files with 17 additions and 22 deletions

View file

@ -1274,7 +1274,6 @@ out:
to_windows_path(symlinked_syslinux);
uprintf("Created: %s\\%s → %s", symlinked_syslinux, efi_cfg_name[i], &path[2]);
to_unix_path(symlinked_syslinux);
fd = NULL;
}
}
} else if (HAS_BOOTMGR(img_report) && enable_ntfs_compression) {

View file

@ -344,23 +344,19 @@ static __inline int DrawTextU(HDC hDC, LPCSTR lpText, int nCount, LPRECT lpRect,
static __inline int GetWindowTextU(HWND hWnd, char* lpString, int nMaxCount)
{
int ret = 0;
DWORD err = ERROR_INVALID_DATA;
if (nMaxCount < 0)
return 0;
DWORD err = ERROR_INVALID_PARAMETER;
if (lpString == NULL || nMaxCount < 1)
goto out;
// Handle the empty string as GetWindowTextW() returns 0 then
if ((lpString != NULL) && (nMaxCount > 0))
lpString[0] = 0;
// coverity[returned_null]
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) ) {
if ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpString, lpString, nMaxCount)) == 0))
err = GetLastError();
}
wfree(lpString);
if (lpString != NULL)
lpString[nMaxCount - 1] = 0;
out:
SetLastError(err);
return ret;
}

View file

@ -800,10 +800,8 @@ out:
fclose(fd_in);
fd_in = NULL;
}
if (fd_out != NULL) {
if (fd_out != NULL)
fclose(fd_out);
fd_out = NULL;
}
// If an insertion occurred, delete existing file and use the new one
if (ret != NULL) {
@ -821,8 +819,10 @@ out:
} else {
uprintf("Could not write '%s' - original file has been left unmodified\n", filename);
ret = NULL;
if (fd_in != NULL) fclose(fd_in);
if (fd_out != NULL) fclose(fd_out);
if (fd_in != NULL)
fclose(fd_in);
if (fd_out != NULL)
fclose(fd_out);
}
}
if (wtmpname != NULL)

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