From 8c94abf7ef2eac1a10ff37429411941be76a84d3 Mon Sep 17 00:00:00 2001 From: "bhutani.92" Date: Thu, 16 Jun 2016 18:11:25 +0530 Subject: [PATCH] [MyFiles] Fixed SVACE Errors Change-Id: Iaec8ec9068eb6ce4c8043527468b1b14df6839a5 Signed-off-by: bhutani.92 --- src/common/file-operation/mf-copy-internal.c | 11 +++++++++++ src/common/mf-fm-svc-wrapper.c | 14 ++++++++++---- src/widget/mf-genlist.c | 5 ++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/common/file-operation/mf-copy-internal.c b/src/common/file-operation/mf-copy-internal.c index 30044b3..1211d01 100755 --- a/src/common/file-operation/mf-copy-internal.c +++ b/src/common/file-operation/mf-copy-internal.c @@ -182,14 +182,25 @@ int _mf_copy_copy_regfile(const char *src, struct stat *src_statp, const char *d const gchar *name = g_path_get_basename(dst); storage_get_root_directory(STORAGE_TYPE_INTERNAL, &root_path); copy_folder = g_strconcat(root_path, "/", ".operation_temp", NULL); + if (!copy_folder) { + fclose(src_f); + return -1; + } dst = g_strconcat(copy_folder, "/", name, NULL); } else if (location == MYFILE_MMC) { copy_dst = (char *)dst; const gchar *name = g_path_get_basename(dst); storage_get_root_directory(STORAGE_TYPE_EXTERNAL, &root_path); copy_folder = g_strconcat(root_path, "/", ".operation_temp", NULL); + if (!copy_folder) { + fclose(src_f); + return -1; + } dst = g_strconcat(copy_folder, "/", name, NULL); } + if (!dst) { + return -1; + } mf_error("===================== copy_dst is [%s], dst is [%s]", copy_dst, dst); if (copy_folder && !mf_file_exists(copy_folder)) { mf_mkpath(copy_folder); diff --git a/src/common/mf-fm-svc-wrapper.c b/src/common/mf-fm-svc-wrapper.c index 38ca5fb..3aab7ba 100755 --- a/src/common/mf-fm-svc-wrapper.c +++ b/src/common/mf-fm-svc-wrapper.c @@ -875,16 +875,22 @@ char *mf_fm_svc_path_info_translate(char *path_info, int path_info_max_len) } if (ret == TRUE) { d_value = last_len - strlen(end); - utf8_last[d_value] = '\0'; - output = g_strconcat(output, sep, utf8_last, omit, NULL); + if (utf8_last) { + utf8_last[d_value] = '\0'; + output = g_strconcat(output, sep, utf8_last, omit, NULL); + } SAFE_FREE_CHAR(temp); } } else { - output = g_strconcat(output, sep, utf8_last, NULL); + if (utf8_last) { + output = g_strconcat(output, sep, utf8_last, NULL); + } SAFE_FREE_CHAR(temp); } } else { - output = g_strdup(utf8_last); + if (utf8_last) { + output = g_strdup(utf8_last); + } SAFE_FREE_CHAR(temp); } SAFE_FREE_CHAR(utf8_last); diff --git a/src/widget/mf-genlist.c b/src/widget/mf-genlist.c index 03628ad..aaa86d6 100755 --- a/src/widget/mf-genlist.c +++ b/src/widget/mf-genlist.c @@ -1388,7 +1388,7 @@ static char *__mf_genlist_cloud_title_get(char *curr_path, Eina_List *storage_li Eina_List *l = storage_list; storage_info* info = eina_list_data_get(l); for (; l; l = eina_list_next(l), info = eina_list_data_get(l)) { - if ((info->type != STORAGE_TYPE_LABEL) && (!strncmp(info->root_path, curr_path, strlen(info->root_path)))) { + if (info && (info->type != STORAGE_TYPE_LABEL) && (!strncmp(info->root_path, curr_path, strlen(info->root_path)))) { return strdup(info->root_name); } } @@ -1402,6 +1402,9 @@ storage_type __mf_genlist_cloud_is_root_path(const char *fullpath, Eina_List *st Eina_List *list = NULL; void *item = NULL; EINA_LIST_FOREACH(storage_list, list, item) { + if (!item) { + continue; + } storage_info *info = item; if ((info->type != STORAGE_TYPE_LABEL) && (!strcmp(info->root_path, fullpath))) { return info->type; -- 2.7.4