mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-21 18:35:26 -04:00
[misc] fix various Coverity issues
* update DLL load/unload * fix resources not being freed and potentially unsafe calls * add extra checks
This commit is contained in:
parent
9aa308213d
commit
266599e6fd
12 changed files with 68 additions and 36 deletions
|
@ -988,7 +988,7 @@ BOOL SetDOSLocale(const char* path, BOOL bFreeDOS)
|
|||
|
||||
if ((cp == 437) && (strcmp(kb, "us") == 0)) {
|
||||
// Nothing much to do if US/US - just notify in autoexec.bat
|
||||
strcpy(filename, path);
|
||||
safe_strcpy(filename, sizeof(filename), path);
|
||||
safe_strcat(filename, sizeof(filename), "\\AUTOEXEC.BAT");
|
||||
fd = fopen(filename, "w+");
|
||||
if (fd == NULL) {
|
||||
|
@ -1004,7 +1004,7 @@ BOOL SetDOSLocale(const char* path, BOOL bFreeDOS)
|
|||
}
|
||||
|
||||
// CONFIG.SYS
|
||||
strcpy(filename, path);
|
||||
safe_strcpy(filename, sizeof(filename), path);
|
||||
safe_strcat(filename, sizeof(filename), "\\CONFIG.SYS");
|
||||
fd = fopen(filename, "w+");
|
||||
if (fd == NULL) {
|
||||
|
@ -1029,7 +1029,7 @@ BOOL SetDOSLocale(const char* path, BOOL bFreeDOS)
|
|||
uprintf("Successfully wrote 'CONFIG.SYS'\n");
|
||||
|
||||
// AUTOEXEC.BAT
|
||||
strcpy(filename, path);
|
||||
safe_strcpy(filename, sizeof(filename), path);
|
||||
safe_strcat(filename, sizeof(filename), "\\AUTOEXEC.BAT");
|
||||
fd = fopen(filename, "w+");
|
||||
if (fd == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue