From: Hwankyu Jhun Date: Mon, 26 Jun 2023 22:11:55 +0000 (+0000) Subject: Fix crash issue of app-defined-loader X-Git-Tag: accepted/tizen/unified/20230628.023654~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae44d35a1eed6719db528d95f5911f8cdcc382a1;p=platform%2Fcore%2Fappfw%2Flaunchpad.git Fix crash issue of app-defined-loader The argument of Plugin::PrepareApp() should not be nullptr. This patch modifies that the implementation of the Plugin::PrepareApp() allows the empty string. If the argument is the empty string, the nullptr will be passed to the plugin function. Change-Id: I6bc62c496ab663965070af512b041928a98ec75e Signed-off-by: Hwankyu Jhun --- diff --git a/src/app-defined-loader/app-defined-loader.cc b/src/app-defined-loader/app-defined-loader.cc index 8d621e1..92fff33 100644 --- a/src/app-defined-loader/app-defined-loader.cc +++ b/src/app-defined-loader/app-defined-loader.cc @@ -150,7 +150,7 @@ class AppDefinedLoader { else if (loader_type == kLoaderTypeHw) setenv("AUL_HWACC", "hw", 1); - int ret = launchpad::Plugin::PrepareApp(nullptr, ex); + int ret = launchpad::Plugin::PrepareApp("", ex); if (ret != 0) { _E("Plugin::PrepareApp() is failed. error(%d)", ret); exit(EXIT_FAILURE); diff --git a/src/lib/launchpad-glib/plugin.cc b/src/lib/launchpad-glib/plugin.cc index f9dfdd5..5caa740 100644 --- a/src/lib/launchpad-glib/plugin.cc +++ b/src/lib/launchpad-glib/plugin.cc @@ -54,7 +54,8 @@ int Plugin::PrepareApp(const std::string& appid, const tizen_base::Bundle& b) { } _W("%s ++", kTagLaunchpadPluginPrepareApp); - int ret = prepare_app_func(appid.c_str(), b.GetHandle()); + int ret = prepare_app_func(appid.empty() ? nullptr : appid.c_str(), + b.GetHandle()); _W("%s --", kTagLaunchpadPluginPrepareApp); return ret; }