From a743c779f8574bd4fb6b35acea963d247e04bc01 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 27 May 2016 04:31:02 +0200 Subject: [PATCH] Prevent some 'conditional jump or move depends on unitialised value' warnings --- menu/cbs/menu_cbs_ok.c | 14 +++++++------- menu/menu_content.c | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 0ea67e9c20..e2b890de50 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -634,14 +634,14 @@ static int action_ok_playlist_entry(const char *path, (core_name_hash == MENU_VALUE_DETECT) ) { - char new_core_path[PATH_MAX_LENGTH]; - char new_display_name[PATH_MAX_LENGTH]; core_info_ctx_find_t core_info; - const char *entry_path = NULL; - const char *entry_crc32 = NULL; - const char *db_name = NULL; - const char *path_base = path_basename(menu->db_playlist_file); - bool found_associated_core = menu_playlist_find_associated_core( + char new_core_path[PATH_MAX_LENGTH] = {0}; + char new_display_name[PATH_MAX_LENGTH] = {0}; + const char *entry_path = NULL; + const char *entry_crc32 = NULL; + const char *db_name = NULL; + const char *path_base = path_basename(menu->db_playlist_file); + bool found_associated_core = menu_playlist_find_associated_core( path_base, new_core_path, sizeof(new_core_path)); core_info.inf = NULL; diff --git a/menu/menu_content.c b/menu/menu_content.c index 10cbf6150b..6067cd677f 100644 --- a/menu/menu_content.c +++ b/menu/menu_content.c @@ -127,7 +127,7 @@ error: **/ static bool menu_content_find_first_core(menu_content_ctx_defer_info_t *def_info) { - char new_core_path[PATH_MAX_LENGTH]; + char new_core_path[PATH_MAX_LENGTH] = {0}; const core_info_t *info = NULL; size_t supported = 0; core_info_list_t *core_info = def_info ? @@ -141,7 +141,8 @@ static bool menu_content_find_first_core(menu_content_ctx_defer_info_t *def_info def_info->dir, def_info->path, def_info->len); #ifdef HAVE_COMPRESSION - if (path_is_compressed_file(def_info->dir)) + if ( !string_is_empty(def_info->dir) + && path_is_compressed_file(def_info->dir)) { /* In case of a compressed archive, we have to join with a hash */ /* We are going to write at the position of dir: */