[MyFiles] Fixed SVACE Errors 90/75090/1 submit/tizen_mobile/20160616.150859
authorbhutani.92 <bhutani.92@samsung.com>
Thu, 16 Jun 2016 12:41:25 +0000 (18:11 +0530)
committerbhutani.92 <bhutani.92@samsung.com>
Thu, 16 Jun 2016 12:41:25 +0000 (18:11 +0530)
Change-Id: Iaec8ec9068eb6ce4c8043527468b1b14df6839a5
Signed-off-by: bhutani.92 <bhutani.92@samsung.com>
src/common/file-operation/mf-copy-internal.c
src/common/mf-fm-svc-wrapper.c
src/widget/mf-genlist.c

index 30044b3..1211d01 100755 (executable)
@@ -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);
index 38ca5fb..3aab7ba 100755 (executable)
@@ -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);
index 03628ad..aaa86d6 100755 (executable)
@@ -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;