diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2021-07-29 11:48:57 +0300 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2021-08-20 13:12:29 +0000 |
commit | b6ab0d0020f6d223e32f5b0393c1b14693445366 (patch) | |
tree | 5c7e585d1363885716e7f7845c57086d7b565776 | |
parent | 55be14bf3f6dbec7042d367b0935ec9bc337f855 (diff) |
homescreen/hs-proxy: Guard against empty appidslamprey_12.1.9lamprey_12.1.8lamprey_12.1.7lamprey_12.1.6lamprey_12.1.5lamprey_12.1.4lamprey_12.1.3lamprey_12.1.20lamprey_12.1.2lamprey_12.1.19lamprey_12.1.18lamprey_12.1.17lamprey_12.1.16lamprey_12.1.15lamprey_12.1.14lamprey_12.1.13lamprey_12.1.12lamprey_12.1.11lamprey_12.1.10lamprey_12.1.1lamprey_12.1.0lamprey_12.0.1lamprey/12.1.9lamprey/12.1.8lamprey/12.1.7lamprey/12.1.6lamprey/12.1.5lamprey/12.1.4lamprey/12.1.3lamprey/12.1.20lamprey/12.1.2lamprey/12.1.19lamprey/12.1.18lamprey/12.1.17lamprey/12.1.16lamprey/12.1.15lamprey/12.1.14lamprey/12.1.13lamprey/12.1.12lamprey/12.1.11lamprey/12.1.10lamprey/12.1.1lamprey/12.1.0lamprey/12.0.112.1.912.1.812.1.712.1.612.1.512.1.412.1.312.1.2012.1.212.1.1912.1.1812.1.1712.1.1612.1.1512.1.1412.1.1312.1.1212.1.1112.1.1012.1.112.1.012.0.1lamprey
Bug-AGL: SPEC-4037
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I6a9b7fd74d81cb117afcb12639862288769b7fde
(cherry picked from commit 36574a78bc7baaf3dd254ed91641fd993fc90c14)
-rw-r--r-- | src/homescreen.cpp | 20 | ||||
-rw-r--r-- | src/hs-proxy.cpp | 2 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/homescreen.cpp b/src/homescreen.cpp index 8470635..49850be 100644 --- a/src/homescreen.cpp +++ b/src/homescreen.cpp @@ -162,9 +162,13 @@ static void tap_shortcut (afb_req_t request) ret = g_hs_instance->client_manager->handleRequest(request, __FUNCTION__, value); if(ret == AFB_REQ_NOT_STARTED_APPLICATION) { std::string id = g_hs_instance->app_info->getAppProperty(value, _keyId); - HS_AfmMainProxy afm_proxy; - afm_proxy.start(g_hs_instance, request, id); - ret = 0; + if (!id.empty()) { + HS_AfmMainProxy afm_proxy; + afm_proxy.start(g_hs_instance, request, id); + ret = 0; + } else { + ret = AFB_EVENT_BAD_REQUEST; + } } } else { @@ -314,9 +318,13 @@ static void showWindow(afb_req_t request) ret = g_hs_instance->client_manager->handleRequest(request, __FUNCTION__, value); if(ret == AFB_REQ_NOT_STARTED_APPLICATION) { std::string id = g_hs_instance->app_info->getAppProperty(value, _keyId); - HS_AfmMainProxy afm_proxy; - afm_proxy.start(g_hs_instance, request, id); - ret = 0; + if (!id.empty()) { + HS_AfmMainProxy afm_proxy; + afm_proxy.start(g_hs_instance, request, id); + ret = 0; + } else { + ret = AFB_EVENT_BAD_REQUEST; + } } } else { diff --git a/src/hs-proxy.cpp b/src/hs-proxy.cpp index cdbf249..ea8976c 100644 --- a/src/hs-proxy.cpp +++ b/src/hs-proxy.cpp @@ -185,7 +185,7 @@ void HS_AfmMainProxy::start(struct hs_instance *instance, afb_req_t request, con * and client context there. We pass the closure_data with the client context * and the application id to remove it. */ - if (!instance) + if (!instance || id.empty()) return; cdata = static_cast<struct closure_data *>(calloc(1, sizeof(*cdata))); |