fix isf-panel-efl crash when widget installation failed 39/33539/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Thu, 22 May 2014 06:11:39 +0000 (15:11 +0900)
committerLi Zhang <li2012.zhang@samsung.com>
Mon, 12 Jan 2015 06:30:55 +0000 (14:30 +0800)
[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

ism/extras/efl_panel/isf_panel_efl.cpp

index 1ab325f..3b0fdba 100644 (file)
@@ -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;