Check arguments of loader 20/295520/2
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 10 Jul 2023 08:04:03 +0000 (17:04 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Mon, 10 Jul 2023 08:21:40 +0000 (08:21 +0000)
Before calling the loader_terminate_cb callback function, the launchpad library
checks whether the argument count is zero or not.
If it's true, the launchpad library does not call the callback function for
backward compatibility.

Change-Id: Ifeb9283701814efe6c1f1b69f4fbf129a3ce9b56
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/launchpad/launchpad_loader.cc

index 14dc76e..e7d733c 100644 (file)
@@ -254,6 +254,9 @@ int LaunchpadLoader::OnTerminate() {
   region_format_config_.reset();
   language_config_.reset();
 
+  if (app_argc_ == 0 || app_argv_ == nullptr)
+    return -1;
+
   if (callback_.terminate != nullptr)
     return callback_.terminate(app_argc_, app_argv_, user_data_);