1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

Fix 'dereference before null check'

This commit is contained in:
twinaphex 2016-06-02 20:56:13 +02:00
parent 307361e12c
commit 79c94513ec

View File

@ -1375,8 +1375,9 @@ static int menu_displaylist_parse_playlist(menu_displaylist_info_t *info,
for (i = 0; i < list_size; i++)
{
uint32_t core_name_hash;
char fill_buf[PATH_MAX_LENGTH], path_copy[PATH_MAX_LENGTH];
char fill_buf[PATH_MAX_LENGTH] = {0};
char path_copy[PATH_MAX_LENGTH] = {0};
uint32_t core_name_hash = 0;
const char *core_name = NULL;
const char *db_name = NULL;
const char *path = NULL;
@ -1389,9 +1390,12 @@ static int menu_displaylist_parse_playlist(menu_displaylist_info_t *info,
playlist_get_index(playlist, i,
&path, &label, NULL, &core_name, &crc32, &db_name);
strlcpy(fill_buf, core_name, sizeof(fill_buf));
core_name_hash = core_name ? menu_hash_calculate(core_name) : 0;
if (core_name)
{
strlcpy(fill_buf, core_name, sizeof(fill_buf));
core_name_hash = menu_hash_calculate(core_name);
}
if (path)
{