Check bundle key 01/187301/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 22 Aug 2018 01:12:56 +0000 (10:12 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 22 Aug 2018 01:14:16 +0000 (10:14 +0900)
If the key of bundle has prefix(AUL or APP_SVC), Launchpad
doesn't add the extra data.

Change-Id: I6396d230b8c2d0309e2a0e35a7436043ce97e0e9
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad_common.c

index df893cd..c59cfa1 100644 (file)
@@ -580,6 +580,20 @@ void _appinfo_free(appinfo_t *menu_info)
        free(menu_info);
 }
 
+static bool __validate_bundle_key(const char *key)
+{
+       if (!key)
+               return false;
+
+       if (!strncmp(key, "__AUL_", strlen("__AUL_")))
+               return false;
+
+       if (!strncmp(key, "__APP_SVC_", strlen("__APP_SVC_")))
+               return false;
+
+       return true;
+}
+
 void _modify_bundle(bundle *kb, int caller_pid, appinfo_t *menu_info, int cmd)
 {
        char *ptr;
@@ -617,7 +631,8 @@ void _modify_bundle(bundle *kb, int caller_pid, appinfo_t *menu_info, int cmd)
                                ptr += flag;
 
                                /*bundle_del(kb, key);*/
-                               bundle_add(kb, key, value);
+                               if (__validate_bundle_key(key))
+                                       bundle_add(kb, key, value);
                        } while (flag > 0);
                } else if (flag == 0)
                        _D("parsing app_path: No arguments");