There is a case where the PID of app_status becomes zero due to some cause.
This patch contains defense against such cases.
Change-Id: If738d297af101d1ee6c3c646466b61f630592440
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
app_status->GetAppID().c_str(), app_status->GetPID(),
app_status->IsStarting() ? "true" : "false",
app_status->GetDelayCount());
+
+ if (app_status->GetPID() <= 0)
+ return;
+
int signo = SIGKILL;
if (!app_status->IsStarting() && app_status->GetDelayCount() >= 10)
signo = SIGABRT;
if (context == nullptr)
return nullptr;
+ if (context->GetPid() <= 1) {
+ _E("Invalid pid(%d)", context->GetPid());
+ return nullptr;
+ }
+
auto found = pid_map_.find(context->GetPid());
if (found != pid_map_.end()) {
auto& app_status = found->second;