From: Jihoon Kim Date: Thu, 22 May 2014 06:11:39 +0000 (+0900) Subject: fix isf-panel-efl crash when widget installation failed X-Git-Tag: submit/tizen/20150128.083920~161 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F39%2F33539%2F1;p=platform%2Fcore%2Fuifw%2Fisf.git fix isf-panel-efl crash when widget installation failed [model] Redwood, B1, B2 [binary_type] PDA [customer] OPEN [issue#] WGT-956 [problem] isf-panel-efi has closed unexpectedly" crash is observed when widget installation gets failed [cause] the return value of package_info_create was not checked and wrong pointer was used [solution] Check the return value of package_info_create API [team] Input Framework [request] N/A [horizontal_expansion] N/A Change-Id: Iddd61d85c7b36aa7d065ac7a8d041ce960e1daba --- diff --git a/ism/extras/efl_panel/isf_panel_efl.cpp b/ism/extras/efl_panel/isf_panel_efl.cpp index 1ab325f..3b0fdba 100644 --- a/ism/extras/efl_panel/isf_panel_efl.cpp +++ b/ism/extras/efl_panel/isf_panel_efl.cpp @@ -1027,13 +1027,16 @@ static bool app_info_cb (package_info_app_component_type_e comp_type, const char *app_id, void *user_data) { HelperInfo *helper_info = (HelperInfo *)user_data; - pkgmgrinfo_appinfo_h appinfo_handle; + pkgmgrinfo_appinfo_h appinfo_handle = NULL; bool exist = false; if (!helper_info) return false; if (pkgmgrinfo_appinfo_get_appinfo (app_id, &appinfo_handle) != PMINFO_R_OK) return true; + if (!appinfo_handle) + return true; + pkgmgrinfo_appinfo_is_category_exist (appinfo_handle, "http://tizen.org/category/ime", &exist); if (exist) { @@ -1048,7 +1051,7 @@ app_info_cb (package_info_app_component_type_e comp_type, const char *app_id, vo static bool get_helper_ise_info (const char *type, const char *package, HelperInfo *helper_info) { - package_info_h pkg_info; + package_info_h pkg_info = NULL; char *pkg_label = NULL; char *pkg_icon_path = NULL; bool result = false; @@ -1059,7 +1062,9 @@ static bool get_helper_ise_info (const char *type, const char *package, HelperIn if (strncmp (type, "wgt", 3) != 0) return false; - package_info_create (package, &pkg_info); + if (package_info_create (package, &pkg_info) != PACKAGE_MANAGER_ERROR_NONE) + return false; + if (!pkg_info) return false;