check NULL pointer derefences on overrides and remaps too
This commit is contained in:
parent
f120ebab45
commit
2d2264fce6
|
@ -1871,8 +1871,16 @@ bool config_load_override(void)
|
||||||
if (!system->info.library_name[0] != '\0' || !strcmp(system->info.library_name,"No Core"))
|
if (!system->info.library_name[0] != '\0' || !strcmp(system->info.library_name,"No Core"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
RARCH_LOG("Overrides: core name: %s\n", system->info.library_name);
|
core_name = system ? system->info.library_name : NULL;
|
||||||
RARCH_LOG("Overrides: game name: %s\n", global->name.base);
|
game_name = global ? path_basename(global->name.base) : NULL;
|
||||||
|
|
||||||
|
if (!core_name || !game_name)
|
||||||
|
return false;
|
||||||
|
if (core_name[0] == '\0' || game_name == '\0')
|
||||||
|
return false;
|
||||||
|
|
||||||
|
RARCH_LOG("Overrides: core name: %s\n", core_name);
|
||||||
|
RARCH_LOG("Overrides: game name: %s\n", game_name);
|
||||||
|
|
||||||
/* Config directory: config_directory.
|
/* Config directory: config_directory.
|
||||||
* Try config directory setting first,
|
* Try config directory setting first,
|
||||||
|
@ -1889,14 +1897,6 @@ bool config_load_override(void)
|
||||||
|
|
||||||
RARCH_LOG("Overrides: config directory: %s\n", config_directory);
|
RARCH_LOG("Overrides: config directory: %s\n", config_directory);
|
||||||
|
|
||||||
core_name = system ? system->info.library_name : NULL;
|
|
||||||
game_name = global ? path_basename(global->name.base) : NULL;
|
|
||||||
|
|
||||||
if (!core_name || !game_name)
|
|
||||||
return false;
|
|
||||||
if (core_name[0] == '\0' || game_name == '\0')
|
|
||||||
return false;
|
|
||||||
|
|
||||||
/* Concatenate strings into full paths for core_path, game_path */
|
/* Concatenate strings into full paths for core_path, game_path */
|
||||||
fill_pathname_join(core_path, config_directory, core_name, PATH_MAX_LENGTH);
|
fill_pathname_join(core_path, config_directory, core_name, PATH_MAX_LENGTH);
|
||||||
fill_pathname_join(core_path, core_path, core_name, PATH_MAX_LENGTH);
|
fill_pathname_join(core_path, core_path, core_name, PATH_MAX_LENGTH);
|
||||||
|
@ -2057,8 +2057,16 @@ bool config_load_remap(void)
|
||||||
if (!system->info.library_name || !strcmp(system->info.library_name,"No Core"))
|
if (!system->info.library_name || !strcmp(system->info.library_name,"No Core"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
RARCH_LOG("Remaps: core name: %s\n", system->info.library_name);
|
core_name = system ? system->info.library_name : NULL;
|
||||||
RARCH_LOG("Remaps: game name: %s\n", global->name.base);
|
game_name = global ? path_basename(global->name.base) : NULL;
|
||||||
|
|
||||||
|
if (!core_name || !game_name)
|
||||||
|
return false;
|
||||||
|
if (core_name[0] == '\0' || game_name == '\0')
|
||||||
|
return false;
|
||||||
|
|
||||||
|
RARCH_LOG("Remaps: core name: %s\n", core_name);
|
||||||
|
RARCH_LOG("Remaps: game name: %s\n", game_name);
|
||||||
|
|
||||||
/* Remap directory: remap_directory.
|
/* Remap directory: remap_directory.
|
||||||
* Try remap directory setting, no fallbacks defined */
|
* Try remap directory setting, no fallbacks defined */
|
||||||
|
@ -2071,14 +2079,6 @@ bool config_load_remap(void)
|
||||||
}
|
}
|
||||||
RARCH_LOG("Remaps: remap directory: %s\n", remap_directory);
|
RARCH_LOG("Remaps: remap directory: %s\n", remap_directory);
|
||||||
|
|
||||||
core_name = system ? system->info.library_name : NULL;
|
|
||||||
game_name = global ? path_basename(global->name.base) : NULL;
|
|
||||||
|
|
||||||
if (!core_name || !game_name)
|
|
||||||
return false;
|
|
||||||
if (core_name[0] == '\0' || game_name == '\0')
|
|
||||||
return false;
|
|
||||||
|
|
||||||
/* Concatenate strings into full paths for core_path, game_path */
|
/* Concatenate strings into full paths for core_path, game_path */
|
||||||
fill_pathname_join(core_path, remap_directory, core_name, PATH_MAX_LENGTH);
|
fill_pathname_join(core_path, remap_directory, core_name, PATH_MAX_LENGTH);
|
||||||
fill_pathname_join(core_path, core_path, core_name, PATH_MAX_LENGTH);
|
fill_pathname_join(core_path, core_path, core_name, PATH_MAX_LENGTH);
|
||||||
|
|
Loading…
Reference in New Issue