From: InHong Han Date: Thu, 16 Apr 2020 10:42:01 +0000 (+0900) Subject: Fix issue detected by static analysis tool X-Git-Tag: accepted/tizen/5.5/unified/20200417.152850~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F88%2F230988%2F1;p=platform%2Fcore%2Fuifw%2Fcapi-ui-sticker.git Fix issue detected by static analysis tool Change-Id: I1f9c417f1c11bc72d214d45a27ffe78695371301 --- diff --git a/server/stickerd_data_manager.c b/server/stickerd_data_manager.c index 2bb0012..9e6455c 100644 --- a/server/stickerd_data_manager.c +++ b/server/stickerd_data_manager.c @@ -874,7 +874,7 @@ int stickerd_insert_sticker_info_by_json(GVariant *parameters, GVariant **reply_ goto free_memory; sticker_info->uri = _get_string_from_object(info_object, "uri"); - if (!sticker_info->uri) + if (!sticker_info->uri || sticker_info->uri[0] != '\0') goto free_memory; if (sticker_info->type == 1) { diff --git a/server/stickerd_db_manager.c b/server/stickerd_db_manager.c index f3acdbd..ad78560 100644 --- a/server/stickerd_db_manager.c +++ b/server/stickerd_db_manager.c @@ -211,12 +211,14 @@ static int _recover_db(void) if (ret != SQLITE_OK) { LOGE("Failed to create sticker_whitelist_info table : %s", err); ret = STICKERD_SERVER_ERROR_DB_FAILED; + goto cleanup; } ret = sqlite3_exec(db, STICKER_RECENT_HISTORY_INFO_CREATE_TABLE, NULL, NULL, &err); if (ret != SQLITE_OK) { LOGE("Failed to create sticker_recent_history_info table : %s", err); ret = STICKERD_SERVER_ERROR_DB_FAILED; + goto cleanup; } is_corrupted = FALSE; diff --git a/sticker-parser/sticker-parser.c b/sticker-parser/sticker-parser.c index a3f96b5..9d73dd3 100644 --- a/sticker-parser/sticker-parser.c +++ b/sticker-parser/sticker-parser.c @@ -605,7 +605,7 @@ static int __get_sticker_info_from_json(const char *appid, const char *file_path goto free_memory; char *rel_thumbnail = __get_string_from_object(info_object, "thumbnail"); - if (rel_thumbnail) { + if (rel_thumbnail && rel_thumbnail[0] != '\0') { thumbnail_path = __convert_sticker_uri(rel_thumbnail, appid, app_path); free(rel_thumbnail); }