Fix crash issue 25/270325/2
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 28 Jan 2022 05:14:57 +0000 (14:14 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 28 Jan 2022 05:25:33 +0000 (14:25 +0900)
Before finding the app status using the appid, AMD should check whether
the appid is nullptr or not.

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

index 80bfc50..a81d286 100644 (file)
@@ -505,9 +505,6 @@ static int __check_request(request_h req)
        if (req->kb == NULL)
                return -1;
 
-       if (bundle_get_val(req->kb, AUL_K_APPID) == NULL)
-               return -1;
-
        if (__can_be_implicit_launch(req->cmd))
                _app_control_resolve(req->t_uid, req->kb);
 
@@ -519,6 +516,9 @@ static int __check_request(request_h req)
        _appinfo_set_effective_appid(req->t_uid, req->kb);
 
        appid = bundle_get_val(req->kb, AUL_K_APPID);
+       if (appid == NULL)
+               return -1;
+
        app_status = __get_app_status(req, appid);
        if (app_status == NULL)
                return 0;